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:

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