Search
Close this search box.
Search
Close this search box.
Search
Close this search box.

5 steps to get unit tests going

Facebook
Twitter
LinkedIn
Pinterest
WhatsApp

Once you start unit testing, you will find significant benefits to your design, throughput, quality, and peace of mind. However, it is not easy to start in an organization that’s not used to it. Here are a number of practical tips:

First step: Make sure the motivation is there – as you will see down the list, this change (like most changes) will require the organization to invest time and work in it. Understand the current situation, understand the pains, get some statistics. There will usually be someone who tried writing unit tests – talk with them, try to understand the challenges. Have a kickoff meeting with the team, understand together why are you doing this and how will the process look like. Have a kickoff with management, you will definitely need their support, you need to be on the same page. Whenever it gets tough (it will), get back to this discussion.

Second step: Train the team – I think training should be minimal – just enough so people will understand what they’re going into. Most of the learning is on the job. I do one day training in which I teach the basics of unit tests in the specific technology (I had lately the opportunity of working with an organization in which I taught c# with visual studio tests, react/native with jest + testing library, angularjs with jest and java with junit). We do some TDD with mob programming and finish with unit tests on legacy code techniques.

At this point some people (highly motivated) may start experimenting. Help them.

Third step: Open roads in the legacy code – adding tests to legacy code is difficult at the beginning. Pair with motivated individuals to crack it up, and find patterns to use on their legacy code (see my video about this: English / Hebrew). Sometimes you’ll need utilities, sometimes you’ll need to do some refactoring to allow people to start work.

Are people starting to write tests? Sometimes they do.

Fourth step: Pair with developers – We had the training, we opened up the roads, and now it is time to start moving the ship. Experience tells me I need to sit with almost all developers and pair with them, writing their first tests. Only when you do that realization seeps in. There are many A-Ha moments, I like it.

You would expect people to start writing unit tests by this time. However, change is very difficult. Remember at the beginning writing the unit test is an additional effort. It returns the investment very fast but it is an additional effort.

Fifth step: Let developers write unit tests without you – this is where, together with the team, we start adding the tests gently into the definition of done. They must do it without you, they must wrestle with the legacy code to get it moving. Like other technological challenges, you need some intensity to grasp them. This is the difficult part.

The first time you change code that already has unit tests is a magical moment. The tests tell you the story in simple words, they guide you and keep you safe. The time and sweat were worth it.

 

Subscribe for Email Updates:

Categories:

Tags:

Continuous Improvement
Spotify
Tips
Professional Scrum Product Owner
The Kanban Method
Lean-Agile Software Development
DevOps
Professional Scrum Master
Scrum.org
Agile Mindset
Agile for Embedded Systems
Lean Software Development
Atlassian
Elastic Leadership
Agile Program
speed @ scale
Agile Release Planning
Kanban Basics
Agile Outsourcing
Lean and Agile Techniques
Sprint Retrospectives
AgileSparks
Nexus vs SAFe
Principles of Lean-Agile Leadership
A Kanban System for Software Engineering
LAB
WIP
Jira admin
Presentation
Iterative Incremental Development
Webinar
Agile and DevOps Journey
Kaizen
ARTs
Achieve Business Agility
Daily Scrum
Artificial Intelligence
Risk Management in Kanban
Self-organization
RTE
Managing Projects
Continuous Deployment
The Agile Coach
Manage Budget Creation
Code
Systems Thinking
Software Development Estimation
ATDD
ScrumMaster Tales
Lean Budgeting
Kaizen Workshop
Test Driven Development
Story Slicing
Implementation of Lean and Agile
SPC
System Team
Business Agility
TDD
Agile Project Management
Agile Israel
Release Train Engineer
PI Planning
Planning
An Appreciative Retrospective
Sprint Planning
Value Streams
Product Ownership
Effective Agile Retrospectives
BDD
Quality Assurance
ALM Tools
predictability
Lean-Agile Budgeting
Accelerate Value Delivery At Scale
Kanban
Agile Marketing
Jira
Lean Risk Management
Frameworks
Introduction to ATDD
Limiting Work in Progress
Agility
POPM
Lean and Agile Principles and Practices
Operational Value Stream
Agile Community
Nexus and Kanban
Legacy Enterprise
Development Value Streams
Engineering Practices
Scrum and XP
Agile Risk Management
RTE Role
Agile Project
Lean Agile Leadership
Agile Testing Practices
Agile Techniques
Entrepreneurial Operating System®
ROI
lean agile change management
Video
Program Increment
Lean Agile Management
EOS®
Kanban Kickstart Example
What Is Kanban
Kanban 101
Lean Agile Organization
Lean Agile
Amdocs
SAFe
Certified SAFe
Scrum Guide
Process Improvement
Agile Assembly Architecture
PI Objectives
User stories
Reading List
Agile Israel Events
AI Artificial Intelligence
LPM
ATDD vs. BDD
Agile Contracts Best Practices
Agile India
Enterprise DevOps
NIT
SA
Covid19
QA
Agile Games
Continuous Planning
RSA
Professional Scrum with Kanban
Change Management
Risk-aware Product Development
SAFe Release Planning
Agile Release Management
Scrum Primer
Tools
Agile Games and Exercises
Rapid RTC
Hybrid Work
Scrum Master Role
Pomodoro Technique
Risk Management on Agile Projects
Atlaassian
Lean Startup
Sprint Iteration
Nexus
Product Management
Continuous Delivery
Acceptance Test-Driven Development
SAFe DevOps
Portfolio for Jira
Jira Cloud
chatgpt
Scrum
Agile in the Enterprise
Software Development
Managing Risk on Agile Projects
Implementing SAFe
System Archetypes
Agile
AI
Agile Product Development
Perfection Game
IT Operations
Agile Basics
Certification
Scaled Agile Framework
Nexus Integration Team
speed at scale
Introduction to Test Driven Development
Lean Agile Basics
Legacy Code
Kanban Game
Continuous Integration
Agile Delivery
Nexus and SAFe
GanttBan
Agile Development
LeSS
System Integration Environments
Agile Product Ownership
ART Success
Scrum Values
Scrum Master
Jira Plans
Releases Using Lean
Coaching Agile Teams
Advanced Roadmaps
agileisrael
Large Scale Scrum
Agile Exercises
Games and Exercises
Applying Agile Methodology
Slides
Scrum With Kanban
AgileSparks
Logo
Enable registration in settings - general

Contact Us

Request for additional information and prices

AgileSparks Newsletter

Subscribe to our newsletter, and stay updated on the latest Agile news and events

This website uses Cookies to provide a better experience
Shopping cart