"ChatGPT in the industry" - Part 5
Requirements management
Can generative AI be inventive? In view of the rapid evolution of AI, this can perhaps be answered with a "yes" at present. In any case, LLMs are already useful tools when it comes to formulating requirement descriptions.
Figure 1: The evolution of a development project.
© talsen teamThe last article in this series(issue 5, pages 14-17) focused on possible support for the description and formulation of work packages using generative tools such as ChatGPT. The legitimate question that arises here is: Where do the requirements that are described in the work packages for technical implementation come from? How can generative methods be used in the requirements analysis and description in the preliminary stages of the project and then during the project?
A systematic process
In theory, requirements management, as described in the standard "IEEE 24765:2017 - Systems and Software Engineering", is a systematic process that is easy to grasp: from requirements elicitation to requirements analysis, requirements specification and requirements validation. In practice, however, it is a great challenge to create good requirements. This is because they should be correct, unambiguous, complete, free of contradictions, rated according to importance and/or stability, verifiable, modifiable and traceable.
>> Read part 1 of the article series "ChatGPT in the industry"!
Two software pioneers put these aspects in a nutshell: As early as 1970, Dr. Winston W. Royce stated that for a development order for a hardware development of around 5 million dollars, a sufficiently good description of the requirements is available with around 30 pages of specifications and a satisfactory project result can therefore be expected. To comprehensively specify a software development project with the same budget, 1500 pages of requirements description would be necessary - for a comparably good project result. In other words, the sheer volume of information to be described is a huge task. Fred Brooks summarized it in his 1995 book "The Mythical Man-Month": "The hardest part of developing a software system is deciding exactly what to build." In addition, in many development projects there is the dynamic that only in the course of the project is enough information available to really decide what really creates value and should therefore be built and what should not. This relationship is also shown in Figure 1 as an orange line (imagination) and a green line (reality).
Requirements often text-based
The good news is, as already explained in part 4 of this series with the creation of agile work descriptions: requirements are very often described in natural language, which is why the use of generative AI tools/LLMs (ChatGPT, Microsoft Copilot, Google Gemine) is almost inevitable. This is because LLMs can handle particularly complex text-based tasks efficiently and offer useful advantages for requirements management by analyzing and generating natural language. Specific text tasks can be, for example Obtaining and summarizing requirements information - describing market and customer descriptions, personas, functional and non-functional requirements, describing technical constraints, describing legal regulations, and generally checking and updating requirements descriptions for consistency. By using LLMs, it is even possible to conduct virtual interviews. And although the results that can be achieved are amazingly useful, it is always important to bear in mind when dealing with AI-generated texts: the results are "only" to be classified as formulation suggestions. Whether it is correct or not is the sole responsibility and responsibility of the prompt creator.
Describe generative requirements
When working with LLMs and creating good prompts, the following simple principle applies: the better the compilation of the input information and the more precise the request, the more useful the generated formulation result that we can expect. As already described for the generation of epics and user stories, "divide and conquer" also applies to the successful use of LLMs for requirements creation. This means breaking down the requirements into coherent content blocks that can also be clearly assigned in terms of their abstraction levels. In prompt engineering terms, the "Chain of Thoughts" technique is the leading prompt tactic. At talsen team, we use the levels of decomposition as described in behavior-driven software development (BDD) in our day-to-day business(Figure 2). It should be noted that the descriptions of the work description merge seamlessly with the descriptions of the specification. This reflects the fact that useful and valuable insights are often gained during the "making" process, from which concrete specifications can be derived. If there is a break in the system or the description logic, this is not only more difficult for product management. It also reduces the potential success of generative AI methods, as the input information for a good prompt is likely to be incomplete.
Figure 3: An example of suitable abstraction levels for the AI-supported, step-by-step, generative creation of requirements descriptions.
© talsen teamIn the following, the value contributions in the dependency tree for the generative creation of specifying and work-describing artifacts along the different levels of abstraction are illustrated using a small example of a simple IIoT application(Figure 3). The subdivision into the different abstraction levels is a great help when using LLMs at the current state of the art. If the queries become too complex or cover too broad a range of content, the responses from ChatGPT and the like are generally generalized and therefore hardly useful in terms of a precise formulation of requirements.
>> Read part 2 of the article series "ChatGPT in the industry"!
The final stage and the source for the decisive details in the specification work are the feature files, which also come from the world of behavior-driven software development. They represent the last level before concrete implementation in tests and productive code. An example of such a feature file - written in the specification language Gherkin as part of a small IIoT example - could be formulated as follows:
- FEATURE: Connect digital temperature sensor via OPC-UA
- SCENARION: Initialization of a temperature sensor
- GIVEN: a functional, installed and commissioned temperature sensor with the ID "123"
- AND the IIoT system is deactivated
- IF the IIoT system is activated
- THEN the temperature sensor is initialized via OPC-UA with the given parameters
- AND the temperature sensor continuously transmits measured values according to the set parameter values.
This result could, for example, be generated automatically from the chain of the previously created, higher abstraction levels of the artifacts. If, as shown in Figure 4, code from the existing code base is integrated into the prompt context, it is also possible to create the test code in parallel with the behavioral description of the feature file. The developer should not be afraid of long prompts: A prompt enriched with all important content may well contain several hundred lines of text.
>> Read part 3 of the article series "ChatGPT in the industry"!
The choice of Gherkin as a proven specification language in behavior-driven software development is not arbitrary. Due to its formalized description structure, Gherkin is very close to the actual process structures in the code. This means that the level of abstraction to executable code and the associated automated test is very low. Prompts that contain Gherkin as input and context are therefore not only extremely precise and yet easy to understand requirement descriptions, but also excellent starting points for generative software creation with LLMs.
Prompt Engineering for good formulations
Using the pyramid of agile specification artefacts described in Figure 2 as the backbone for efficient prompts, it is possible to implement the "divide and conquer" principle well. This means that the prompt can always be optimally supplemented with the relevant context without overloading the request with too much information. However, it should be borne in mind that the generation of requirement descriptions still has a relatively high level of complexity for generative AI, even with well-graduated levels of abstraction. In addition to the prompt strategies and tactics already mentioned in the previous articles, it is therefore worth taking a closer look at the following four special prompt techniques for complex requests. These all deal with a step-by-step decomposition and step-by-step enrichment of the solution and thus fit perfectly with the described decomposition approach for specification artifacts.
| Data and legal security |
|---|
|
When using generative AI, it must be taken into account that the use of commercially hosted LLMs or the correspondingly available website in the browser usually results in data being transferred to the provider's servers without further precautions. Depending on the location of the server in Europe, the USA or Asia, these are subject to the data protection regulations of that location. Before using a corresponding service, it should be clarified where the servers are located, what the legal framework conditions are and what other rights of use the LLM provider guarantees, such as the use of logged chat histories for future model training. Some commercial providers make their AI services available on special servers in Europe or offer the option of not using the data themselves in any way. As an alternative, freely accessible models are available that can be hosted on their own high-performance servers, thus ensuring data security in accordance with the respective company guidelines. The individual risk/benefit assessment and the appropriate technical setup are derived from these boundary conditions. As far as IP rights are concerned, the topic of AI-generated results and IP rights is still a legal issue in flux. On the one hand, the question has not yet been conclusively clarified and also varies depending on the provider of the AI services: who actually owns the rights to the generated results? After all, these results are generated on the basis of existing data with a corresponding legal claim. |
- Few-shot: Few-shot refers to a method in which one or more examples are provided in the prompt context in order to prepare or adapt the LLM for a specific task. These examples are used to give the model a concrete understanding of the task. This technique is often used to quickly adapt models to specific scenarios. For example, the use of document templates, as shown here, is a concrete example of the Few-Shot technique.
- Chain of Thought: The Chain of Thought technique uses an LLM to first develop an explicit, step-by-step solution to complex problems before deriving the final answer. On the one hand, this helps to track the "thought processes" of the model. On the other hand, it is suitable for improving the accuracy of difficult tasks. This technique is highly recommended for solving problems that require logical thinking or mathematical calculations.
- Tree of Thought: Tree of Thought is an extension of the Chain of Thought technique in that different possible thought paths are examined by the model in a tree-like structure. This gives the LLM the opportunity to explore several possible solutions at the same time. Finally, the model evaluates the respective plausibility and selects the best solution from the variants developed. This method improves decision-making in complex or ambiguous situations in particular, as it enables a more in-depth analysis of the options.
- Step-back: The step-back technique is also used in complex solution processes and means that the LLM does not immediately give the answer to the question but first tries to recognize and explain the underlying general principle of the task or problem. The actual question is then answered using this self-created content foundation. This makes it possible to achieve good and well-founded solutions even for difficult questions.
The good requirements description
Whether the requirements description process is carried out using BDD methods and artifacts or not is, in principle, easily interchangeable. The prompts can be easily adapted to the prevailing methodology, processes and document types in the individual company environment. The key to efficient and high-quality generative creation of requirements descriptions is the quality and granularity of the context as input and the complexity of the questions or the leap between the levels of abstraction in the requirements description process. With regard to the current state of LLM intelligence, both can be covered very well with BDD methods and description forms in combination with the aforementioned prompt techniques and should definitely be worth considering for the next "generated" project.


















