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:

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