A quick one: Testing log messages — Camille Fournier
I'm writing a talk on unit testing for work, and it reminded me of one of the coolest things I learned from the ZK code base with respect to testing: testing log messages. You probably don't want to rely too heavily on log messages for testing, but sometimes it's the only indication you have that
I'm writing a talk on unit testing for work, and it reminded me of one of the coolest things I learned from the ZK code base with respect to testing: testing log messages. You probably don't want to rely too heavily on log messages for testing, but sometimes it's the only indication you have that a certain condition happened. So how do you test it? Layout layout = Logger.getRootLogger().getAppender("CONSOLE") .getLayout(); ByteArrayOutputStream os = new ByteArrayOutputStream(); WriterAppender appender = new WriterAppender(layout, os); appender.setImmediateFlush(true); appender.setThreshold(Lev
related reading
- GitHub - mawrkus/js-unit-testing-guide: 📙 A guide to unit testing in Javascriptgithub.com
- Why Good Developers Write Bad Unit Tests · mtlynch.iomtlynch.io
- Google Testing Blog: Testing on the Toilet: Test Behaviors, Not Methodstesting.googleblog.com
- What if writing tests was a joyful experience?blog.janestreet.com
- Software Engineering at Googleabseil.io
- Logging, Tracing, Monitoring, et al.alexandruburlacu.github.io
- Reading 2: Testingweb.mit.edu
- CSC 151 - Unit Testingeikmeier.sites.grinnell.edu
- sbensu: How to: friction logsblog.sbensu.com
- Testing robotics systems in fast-paced startups | Michael Jae-Yoon Chungmjyc.github.io
- GitHub - abhivaikar/howtheytest: A collection of public resources about how software companies test their softwaregithub.com
- evlog — Digging through logs is not observability. It's hope.evlog.dev