Generating unit tests automatically with large language models
A proof of value shows that a language model with retrieval-augmented generation writes unit tests live for the bank's code.
The challenge
At Zürcher Kantonalbank, almost two thirds of the lead time in the change process went into testing and acceptance. Good tools for this repetitive work were missing.
Our approach
We compared code-based language models and fine-tuning methods, built a pipeline to collect data from open-source Java repositories and fine-tuned CodeLlama.
A retrieval-augmented system fetches the relevant code context and creates the prompts automatically.
The impact
- Working prototype on ZKB's code base
- Unit tests for any code, with GPT-4 or the fine-tuned model
- Basis for faster bug detection and higher test coverage
Related client impact
All case studies
Life sciences & healthcare · Software & AIAutomating invoice capture with multimodal language modelsA system built on multimodal language models reads invoices from PDF attachments and posts them straight into the ERP. 83.8% of invoices run fully automatically.View project
Industrials & manufacturing · Software & AIAnswers from machine manuals in secondsAn AI assistant based on retrieval-augmented generation (RAG) that answers support questions straight from the technical manuals and states where each answer comes from.View project