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:

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