How AI Can Support Software Architects: A practical example without the hype

The Challenge of Quality Requirements

Quality or "non-functional" requirements are often a pain point in software development. Many professionals find it difficult to formulate them correctly, whether they are product owners, requirements engineers, business analysts or even software engineers.

This task often falls to the software architect.

But even for architects, who are more technically oriented, it can be a challenge to effectively support the formulation of quality requirements.

The Importance of Structured Quality Requirements

As described in a previous blog post, a clearly defined structure is crucial for the formulation of quality requirements.

A Guide to Non-Functional Requirements for Software Architects
Discover modern techniques and tools to effectively elicit, document and improve the management of the quality requirements of a software initiative.

Quality scenarios, such as those developed by Bass, provide a reliable template for this.

As a rule, product owners, requirements engineers and software developers know that their software systems must be "fast", "secure" and "maintainable".

However, their understanding often remains vague.

Leveraging AI for Quality Requirement Formulation

This is where the software architect comes into play, supported by AI (e.g. ChatGPT).

Let’s look at an example to illustrate this process:

Imagine we have an eCommerce web application for IT geek hardware with the following core components:

  • Home
    • Optimized for Navigation
    • Recommended Products
    • Product Search
  • Product Detail Page:
    • Comprehensive Product Information and Specifications
  • Cart
    • Efficient Shopping Cart Management for a Seamless Experience
  • Checkout Functionality
    • Secure Checkout Process with Integrated Payment Options

We expect 200 simultaneous users and a catalog with 10,000 products. Our target users are mainly IT geeks.

The web application must be fast, secure and accessible, and our products should be easy to find via Google.

It also needs to be maintainable and easy to integrate new features.

Simplifying Quality Requirements with ChatGPT

Instead of manually struggling with formulating quality requirements, you can take inspiration from ChatGPT.

Here is an example of a prompt that will help you elaborating quality requirements:

Example Prompt for elaborating quality requirements:

"ChatGPT, I need help formulating quality requirements for an IT eCommerce web application. The application includes a home page with product search, product detail pages, a shopping cart and a checkout function with payment processing. We expect 200 concurrent users and a catalog with 10,000 products. The main users are IT geeks. The application must be fast, secure, accessible, easy to find via Google, maintainable and expandable with new features. Can you help me define clear and structured quality requirements for this scenario?"

Example Result

Response Time

  • Home Page: Must load within 2 seconds under normal conditions
  • Product Search: Results must be displayed within 3 seconds
  • Product Detail Page: Must load within 2 seconds
  • Cart: Must load within 2 seconds
  • Checkout: Each step must load within 2 seconds
  • Payment Processing: Must complete within 5 seconds.

Scalability

  • The application must support 200 concurrent users without degradation in performance.

Throughput

  • The system must handle up to 10 transactions per second during peak times.

Security Requirements

  • Data Encryption: All data transmissions must use SSL/TLS encryption.
  • Authentication: Implement multi-factor authentication for user accounts.
  • Authorization: Ensure role-based access control (RBAC) for different user roles.
  • Data Protection: Personal data must be encrypted in storage.
  • Compliance: The application must comply with GDPR, CCPA, and PCI-DSS standards.

Accessibility Requirements

  • WCAG Compliance: The application must meet WCAG 2.1 AA accessibility standards.
  • Keyboard Navigation: All functionalities must be accessible via keyboard navigation.
  • Screen Reader Compatibility: Ensure compatibility with popular screen readers like JAWS and NVDA.

SEO Requirements

  • Meta Tags: Proper meta tags (title, description, keywords) must be implemented for all pages.
  • Sitemap: Generate and maintain an XML sitemap.
  • URL Structure: Use SEO-friendly URLs.
  • Mobile Optimization: Ensure the website is mobile-friendly and passes Google's Mobile-Friendly Test.

Maintainability Requirements

  • Code Quality: Follow industry best practices for clean and modular code. Use linting tools.
  • Documentation: Provide comprehensive documentation for code, APIs, and system architecture.
  • Version Control: Use version control (e.g., Git) for all development work.
  • Testing: Implement automated unit, integration, and end-to-end tests. Aim for at least 80% code coverage.

Extensibility Requirements

  • Modular Architecture: Design the system using a modular architecture to facilitate easy addition of new features.
  • API-First Design: Develop APIs for all major functionalities to enable integration with other systems.
  • Plugin System: Implement a plugin system to allow third-party developers to add functionalities without modifying the core code.

Usability Requirements

  • User Interface: The UI must be intuitive and user-friendly for IT professionals.
  • Feedback: Provide real-time feedback on user actions (e.g., add to cart, form submissions).
  • Help and Support: Include a comprehensive help section and live chat support.

Reliability Requirements

  • Uptime: Ensure 99.9% uptime, excluding scheduled maintenance.
  • Backup: Implement regular data backup and ensure quick restoration capabilities.
  • Error Handling: Gracefully handle errors with user-friendly messages and logging for troubleshooting.

Legal and Ethical Requirements

  • Privacy Policy: Clearly state the privacy policy regarding data usage.
  • Terms of Service: Provide detailed terms of service for users.
  • Ethical Considerations: Ensure no misleading information or unethical practices are employed.

User Support Requirements

  • Documentation: Provide comprehensive user documentation and FAQs.
  • Support Channels: Offer multiple support channels, including email, phone, and live chat.
  • Response Time: Aim to respond to user inquiries within 24 hours.

This sample answer gives you a good overview of possible quality goals and quality requirements that you will have.

Once you have selected the most important goals or requirements, you can go deeper. Let's say we choose :

Response Time / Home Page: Must load within 2 seconds under normal conditions

'Load within 2 seconds' is quite good, but if we take a look at the frontend architecture, this should become even clearer. See my post on frontend architecture blog post for more details.

Which web frontend architecture fits best?
This post will help you find the right web frontend architecture that best fits your specific quality goals.

In frontend engineering, there are various well-known performance metrics such as Google Web Vitals that you can use to measure the speed of your web frontend.

So let the AI inspire you whether 2 seconds loading time is okay for you.

Example Prompt for detailling quality requirements:

Let's choose the response time: Home page: Must load within 2 seconds under normal conditions. Can you create quality scenarios based on the Google Web Vitals to create measurable quality requirements based on Bass's quality scenario.

Example result with detailed quality requirements for a quality goal

Quality Scenario 1: Time to First Byte (TTFB)

  • Stimulus: A user navigates to the home page.
  • Stimulus Source: End-user on a device with fast 3G or better network connection.
  • Environment: Production environment.
  • Artifact: Home page of the web application.
  • Response: The Time to First Byte (TTFB) should be quick.
  • Response Measure: 75% of users should experience TTFB within 0.5 seconds as measured by server logs and Google Web Vitals.

Quality Scenario 2: First Contentful Paint (FCP)

  • Stimulus: A user navigates to the home page.
  • Stimulus Source: End-user on a device with fast 3G or better network connection.
  • Environment: Production environment.
  • Artifact: Home page of the web application.
  • Response: The First Contentful Paint (FCP) should occur quickly.
  • Response Measure: 85% of users should experience FCP within 1 second as measured by Google Web Vitals.

Quality Scenario 3: Largest Contentful Paint (LCP)

  • Stimulus: A user navigates to the home page.
  • Stimulus Source: End-user on a device with fast 3G or better network connection.
  • Environment: Production environment.
  • Artifact: Home page of the web application.
  • Response: The Largest Contentful Paint (LCP) should occur within 2 seconds.
  • Response Measure: 75% of users should experience LCP within 2 seconds as measured by Google Web Vitals.

Quality Scenario 4: Cumulative Layout Shift (CLS)

  • Stimulus: A user navigates to the home page and starts reading or interacting with the content.
  • Stimulus Source: End-user on a device with fast 3G or better network connection.
  • Environment: Production environment.
  • Artifact: Visual layout of the home page.
  • Response: The Cumulative Layout Shift (CLS) should be minimal.
  • Response Measure: The CLS score should be less than 0.1 for 95% of user sessions as measured by Google Web Vitals.

By using AI, you can support the process of defining quality requirements and ensure that they are precise, comprehensive and aligned with the needs of your software initiative.

By the way: Take a look at the arc42 quality model. As described in my blog post on quality requirements, it is a straightforward and practical method for evaluating product and system quality. There are quite a few examples of quality requirements formulated with the help of ChatGPT.

Conclusion

Formulating quality requirements doesn’t have to be a daunting task.

With the right techniques and AI, software architects can efficiently develop well-structured and effective quality requirements that lead to better software outcomes.

Try integrating AI (like ChatGPT) into your workflow and experience the difference in the quality of your requirements.