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
Explore this link on the map →related reading
- Why Good Developers Write Bad Unit Tests · mtlynch.iomtlynch.io
- Google Testing Blog: Testing on the Toilet: Test Behaviors, Not Methodstesting.googleblog.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
- Testing robotics systems in fast-paced startups | Michael Jae-Yoon Chungmjyc.github.io
- Google Testing Blog: How Much Testing is Enough?testing.googleblog.com
- sbensu: How to: friction logsblog.sbensu.com
- Google Testing Blogtesting.googleblog.com
- The Joel Test: 12 Steps to Better Code – Joel on Softwarejoelonsoftware.com
- Reading 3: Testingweb.mit.edu