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:

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