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