unit testing

Articles

Car steering wheel photo by Nicolai Berntsen A Case for Test-First Development

You may feel you don't have time to write unit tests, but you really don't have time not to. Steve Poling makes the case that writing tests first not only will yield better code, but will help you get that code working right sooner. Here's how using a test-first approach changes your thinking about coding, lets you see mistakes immediately, and helps you create more testable code.

Steve Poling's picture Steve Poling
Path breaking away from a road Learn More from Tests That Stray off the Happy Path

Unit tests exercise various paths through your codebase. Some are happy paths where everything you expect goes right. These tests are boring. The interesting tests are the ones where your code goes hurtling off the happy path. The trick is to capture the diversity of a multitude of unhappy paths without needlessly duplicating unit tests. Here's how you can improve the quality of your unit testing and fix it more effectively.

Steve Poling's picture Steve Poling
Changeable code The Value of Test-Driven Development when Writing Changeable Code

Writing changeable code makes it easier and more cost-effective to add features to existing software. Writing changeable code doesn’t take longer, but it does require paying attention to certain things when building a system. It's important to have a good suite of unit tests that support refactoring code when needed, and test-driven development helps you create independently testable code.

David Bernstein's picture David Bernstein
Pencil to paper Document Why as Well as What: Finding the Purpose of Your Software

Code can express what we want to accomplish, but it’s a little more difficult to express why we’re doing something in the first place. The people who maintain code are often not those who originally wrote it, so documenting why helps set a context and gives clues as to what the author was thinking when they came up with a particular design, making developers' jobs easier.

David Bernstein's picture David Bernstein
Leader Tester-Driven Unit Testing: Taking an Active Role

Developers have so much to do that unit tests often fall by the wayside. One solution is to train testers to handle them. Testers get involved earlier in the development lifecycle, they can enhance their programming skills, and bugs are found and fixed quickly and easily, reducing the functional testing phase. Consider taking an active role in unit testing.

RoboCop Building a Better RoboCop: The Stages of Software Testing

In the movie RoboCop, the cyborg law enforcement officer advised people to “Stay out of trouble.” This article focuses on ways to stay out of trouble when building a software product by following the stages of software testing, using the 1987 movie’s titular character as an example. Let’s examine each testing stage and see if we can build a better RoboCop.

Michael Mak's picture Michael Mak
Unit vs. System Testing-It's OK to be Different

There are two distinct roles in many software projects that are involved with testing: developers and testers. Should they take the same approach to testing, or are there some principles that apply to only one of the roles? What should they do to coordinate their work? Danny Faught went through an exercise to compare and contrast and found that the questions he couldn't answer were as interesting as the questions he could answers.

Danny R. Faught's picture Danny R. Faught
test automation Not Your Father's Test Automation

If you think that test automation is mostly about executing tests, then you're missing out on a big opportunity. Or rather, you're missing a lot of small opportunities adding up to a big one. Consider this: stop thinking about test automation as merely executing automated tests, stop thinking about test automation as something you need expensive tools for, and start discovering automation you can implement in a couple of days and usually with extremely inexpensive tools or tools you already have available. In this week's column, Danny Faught and James Bach suggest taking a more Agile approach to test automation.

James Bach's picture James Bach Danny R. Faught

StickyMinds is a TechWell community.

Through conferences, training, consulting, and online resources, TechWell helps you develop and deliver great software every day.