Don’t Let Unit Tests Become Your Enemy

Tips and best practices to avoid the pitfalls of unit testing

Every year, Cognizant Softvision dedicates a full week to global developers and software engineers. Our seventh-annual event, Programmers’ Week 2021, was filled with inspiring keynotes, tech talks and discussions, all focusing on professional development, training, industry knowledge and trending technologies. 

Throughout Programmers’ Week 2021, Cognizant Softvision experts from our global studios shared their insights and knowledge. Cristian Kocza, Cognizant Softvision full-stack software engineer, joined the speaker lineup to share his expertise on unit testing.

Many things can go wrong with unit testing. “Sooner or later, you’ll start noticing that unit tests take longer and longer…and worse, sometimes the tests could start failing. Even worse, you won’t get reliable failures,” said Cristian.

According to Cristian, unit testing could cause you to miss deadlines. But unit tests don’t need to be your enemy.

During his presentation, Cristian shared his insights and best practices on unit testing, including:

  • The dark side of unit tests and how to avoid them
  • The benefits of testing
  • What to test
  • What is a unit?
  • Tips on using test doubles
  • Refactoring
  • Signs that something went wrong

Find out more and watch his full presentation here:

To learn more about Programmers’ Week, click here.