Decomposition in Software Testing

The mightiest rivers lose their force when split up into several streams.

Ovid

What Is Decomposition?

The academic definition of decomposition is “a method that allows us to replace the solution of a complex problem with the solutions of many interrelated but smaller problems”. In simple words, we divide a whole into parts to make it more convenient to interact (analyze, manage etc.) with each of the smaller parts.

Decomposition is widely used in computer science and project management, particularly in software development. In this article, we will look at cases of its use by testing professionals.

Decomposition is usually represented as a hierarchical tree, but for testing purposes it may simply mean that the system (or its individual components or functional parts) is seen as consisting of relatively independent subsystems, each of which is much easier to test than the whole system at once (we will refer to any application under test as the “system”).

Why Decompose?

In general, decomposition is used to:

  • aid in the assessment of project feasibility, as well as the resources required to complete it
  • determine the sequence of project tasks and their priorities
  • delegate tasks to team members depending on their qualifications and other skills

Often decomposition also helps cope with procrastination: if the system is too complex, we understand WHAT to test, but we may not understand HOW to do it or WHERE to start.

When applied to software testing, decomposition is useful for:

  • collecting information about the system when performing exploratory testing
  • writing checklists or test scenarios (e.g., for regression testing)
  • analyzing and testing requirements
  • test planning (evaluation and prioritization of required resources)
  • designing automated checks based on page object pattern

Decomposition in the testing process helps us achieve better quality and provides greater confidence.

Decomposition Criteria

As an example, we will use a typical site for ordering pizza and various additions to it. Our site is called “My Tasty Pizza” has a typical structure:

  • a global navigation bar and buttons to sign up/sign in at the top
  • a carousel of images linked to pages with information on new products and deals in the middle
  • a footer section with contact information, links to mobile applications, and pages of the pizzeria in social networks at the bottom

Before we start decomposing our system, we need to decide what criteria we will use for that. Let’s review a few basic ones.

Decomposition by GUI Elements

When decomposing the system, we rely on the elements of its graphical user interface as a guide.

We look at the system through the eyes of its users, and thus can quickly provide coverage of the most important, visible functionality.

The disadvantage of this approach is that we don’t see “invisible” functionality, such as API functions that are not accessible through the GUI.

Decomposition by User Actions

The system is decomposed based on the actions users can perform on the website:

This approach is applicable to a vast majority of systems and can be used in addition to GUI-based approach to extend coverage.

Unfortunately, such versatility is also a disadvantage, because it may not always correctly reflect the relationships between the subsystems with some of them depending on each other, which makes it impossible to test them in isolation.

Decomposition by Business Process Stages

This is a more advanced approach that ensures maximum consistency with real use cases.

For example, when ordering a pizza, the user performs several consecutive steps and goes through a series of states: signing in (ordering scenario is also possible without signup), choosing a pizza from the menu, selecting toppings (an optional step), adding everything to the cart, and making a payment. Once the order is complete, the user can track the delivery on the website or in the mobile app. In addition, the order can be picked up at the selected restaurant, or the user can order catering services (a separate use case).

Since each individual scenario corresponds to a specific use case, it provides good traceability to requirements and ability to quickly test and deliver a minimal viable product (MVP).

On the other hand, effective decomposition using this approach requires well-designed and documented requirements and use cases.

Other Decomposition Approaches

There are other approaches to decomposition that depend on the system, qualifications of the tester, and the goals of testing.

For example, we can decompose based on data that our system takes as input, then stores and processes, and finally passes to output (“inputs/process/outputs” approach). This includes processing web forms, opening, saving, and printing files, exporting internal data for interoperability with other systems, etc.

A role-based/security decomposition is also possible when there are accounts with different access levels in the system. Unregistered users may have no access to certain parts of the system, registered users will have limited access, and administrators will have full set of permissions everywhere. Given that, each role will have its own specific scenarios for using the system.

Decomposition Best Practices

For more efficient decomposition, consider the following:

  • Each act of decomposition forms a new level of depth (the original system is at level 0)
  • All subsystems at the same level, which are children of the same parent system, should be decomposed by the same criteria. In other words, all those subsystems should answer the same question concerning their parent
  • At each level, it is recommended to have no more than 7 subsystems. It is believed that a human brain is less efficient at comprehending a larger number of items than this
  • The total number of levels should be 2 to 6, while 3 is optimal in most cases. The depth depends on the degree of understanding of the system by the decomposer. Lowest level subsystems are called “elementary”, and if decomposition is done to create a checklist, such subsystems represent ideas for tests
  • Critically re-evaluate decomposed system time to time. Is everything covered? Maybe there are redundant or overlapping branches? Does the system have external relationships (integrations with other systems, external user groups, etc.)?
  • Think ahead of any future changes in requirements if the system is going to be expanded since the changes will be represented by additional subsystems on existing levels

Recommended Reading

If you’re interested in learning more about this topic, I highly recommend “Righting Software” by Juval Löwy.

Related Blog Posts

We hope you’ve found this to be helpful and are walking away with some new, useful insights. If you want to learn more, here are a couple of related articles that others also usually find to be interesting:

Our Gear Is Packed and We're Excited to Explore With You

Ready to come with us? 

Together, we can map your company’s software journey and start down the right trails. If you’re set to take the first step, simply fill out our contact form. We’ll be in touch quickly – and you’ll have a partner who is ready to help your company take the next step on its software journey. 

We can’t wait to hear from you! 

Main Contact

This field is for validation purposes and should be left unchanged.

Together, we can map your company’s tech journey and start down the trails. If you’re set to take the first step, simply fill out the form below. We’ll be in touch – and you’ll have a partner who cares about you and your company. 

We can’t wait to hear from you! 

Montage Portal

Montage Furniture Services provides furniture protection plans and claims processing services to a wide selection of furniture retailers and consumers.

Project Background

Montage was looking to build a new web portal for both Retailers and Consumers, which would integrate with Dynamics CRM and other legacy systems. The portal needed to be multi tenant and support branding and configuration for different Retailers. Trailhead architected the new Montage Platform, including the Portal and all of it’s back end integrations, did the UI/UX and then delivered the new system, along with enhancements to DevOps and processes.

Logistics

We’ve logged countless miles exploring the tech world. In doing so, we gained the experience that enables us to deliver your unique software and systems architecture needs. Our team of seasoned tech vets can provide you with:

Custom App and Software Development

We collaborate with you throughout the entire process because your customized tech should fit your needs, not just those of other clients.

Cloud and Mobile Applications

The modern world demands versatile technology, and this is exactly what your mobile and cloud-based apps will give you.

User Experience and Interface (UX/UI) Design

We want your end users to have optimal experiences with tech that is highly intuitive and responsive.

DevOps

This combination of Agile software development and IT operations provides you with high-quality software at reduced cost, time, and risk.

Trailhead stepped into a challenging project – building our new web architecture and redeveloping our portals at the same time the business was migrating from a legacy system to our new CRM solution. They were able to not only significantly improve our web development architecture but our development and deployment processes as well as the functionality and performance of our portals. The feedback from customers has been overwhelmingly positive. Trailhead has proven themselves to be a valuable partner.

– BOB DOERKSEN, Vice President of Technology Services
at Montage Furniture Services

Technologies Used

When you hit the trails, it is essential to bring appropriate gear. The same holds true for your digital technology needs. That’s why Trailhead builds custom solutions on trusted platforms like .NET, Angular, React, and Xamarin.

Expertise

We partner with businesses who need intuitive custom software, responsive mobile applications, and advanced cloud technologies. And our extensive experience in the tech field allows us to help you map out the right path for all your digital technology needs.

  • Project Management
  • Architecture
  • Web App Development
  • Cloud Development
  • DevOps
  • Process Improvements
  • Legacy System Integration
  • UI Design
  • Manual QA
  • Back end/API/Database development

We partner with businesses who need intuitive custom software, responsive mobile applications, and advanced cloud technologies. And our extensive experience in the tech field allows us to help you map out the right path for all your digital technology needs.

Our Gear Is Packed and We're Excited to Explore with You

Ready to come with us? 

Together, we can map your company’s tech journey and start down the trails. If you’re set to take the first step, simply fill out the contact form. We’ll be in touch – and you’ll have a partner who cares about you and your company. 

We can’t wait to hear from you! 

Thank you for reaching out.

You’ll be getting an email from our team shortly. If you need immediate assistance, please call (616) 371-1037.