Retrieval-Augmented Generation (RAG) for Quality Engineering: A Practical Guide
Moulinath Chakrabarty
AI-Powered Software Engineering | Generative AI, Responsible AI & Self-Healing AI | Insurance | Writer
Why Quality Engineering Needs RAG
Imagine you have managed to find the recipe of a fancy-looking pudding. You go to the grocery store and gather even fancier ingredients. You come back and make what you feel would change the world. Then, you taste it and YUCK. In other words, you have managed to hit up the perfect recipe for disaster and messed up the real proof of the pudding. Culinary delight, customer delight- you get the drift.
Similarly, Quality is the heart of software engineering. You can do your fancy programming and bring the best of AI, however all that will fall flat if you have not hit the Quality mark. Quality Engineering (QE) within the construct of Software Engineering is rapidly evolving and embracing AI. However, as our friendly neighborhood hero believes- “With Great Power Comes Great Responsibility.’ Generative AI can transform the way you ensure Quality; however, you also owe yourself and your customer a guardrail against hallucinations, outdated information, and context accuracy.
This is where you have an option to consider Retrieval-Augmented Generation (RAG). You can make use of your institutional data to build a custom RAG and then integrate retrieval mechanism and build inferences- all with the intent and pathway to produce a set of outcomes that is contextual to you.
?
How Can RAG Help in Quality Engineering?
As a starting point towards making a RAG-strong QE framework, let us look at the points of impact and how a custom RAG can elevate the outcomes:
The flowchart can look like this:
Flowchart Steps:
?
Example Flow Summary
?
RAG can be used for test data generation in three phases:
Retrieval phase- A Knowledge Base of test data can be created that stores previous test data for test scenarios, requirements, Edge cases etc. When there is a need for new test data for testing a new feature, the system can retrieve the most relevant test data.
Generation phase- Generative AI can be used to produce new test data by extrapolating or modifying the retrieved data. The model can also combine multiple sources of test data to create a more comprehensive test set.
Continuous Learning: Over time, the RAG system will learn from common defect patterns or business rules to ensure the syntactical correctness of the test data as well as relevance.
The flowchart could look like this:
1.????? Set up Knowledge Base from test case repository, defect data, test data examples and put in a vectorize database like Elasticsearch or Pinecone
2.????? Retrieval from Knowledge Base using a requirement as input and using techniques like Maximum Marginal Relevance, similarity scoring
3.????? Preprocess retrieved data to ensure cleansing
4.????? Generation phase using OpenAI or other GPT models
5.????? Post-processing, and merger of retrieved and generated data
?
Choosing Between Public LLMs and Private LLMs for RAG in QE
One of the key decisions when implementing RAG in QE is whether to use public LLMs (like OpenAI’s GPT models) or build private, customized LLMs. The perspectives to consider are:
Public LLMs (e.g., GPT-4, Google Gemini)
Advantages:
Disadvantages:
?
Private LLMs (e.g., Llama, GPT-NeoX, Mistral)
Advantages:
Disadvantages:
Evaluation Criteria:
?
?
?
Conclusion: Empowering Quality Engineering with RAG
RAG can transform Quality Engineering by harnessing the power of institutional data. By seamlessly integrating historical insights with innovative AI technologies, RAG can drive efficiency based on organizational knowledge.
Whether you choose to deploy public LLMs for quick wins or invest in a tailored private LLM for long-term scalability, you can drive the most optimal benefits by making the best possible use of your data. You will be able to use the power of AI to continuously learn and recalibrate, while always staying relevant with your organizational context.
In a world where quality is the ultimate differentiator, integrating RAG into your QE pipeline is not just a technological advantage; it can be a strategic imperative. By combining historical data, generative AI, and continuous learning, you can ensure that the proof of the pudding is always to your customer's delight.
?
?
Kennis extraheren aan AI modellen is mijn uitdaging
1 周Would RAG be sensitive to (tautological) self-reference? (Just curious )
Senior Technology Manager | Modern Workplace | Ex - Nestlé | Ex - Telstra | Ex - SingTel | Microsoft 365 | Automation | Power Platform | AI Search / ML | Coveo | Learner | Evangelist
1 周Great read !!