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:

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