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:

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