metindeder/test-master-unit-test-model-GGUF
TestMaster-7B-GGUF: Resource-Efficient Polyglot Unit Test Generator
TestMaster-7B is a specialized Large Language Model (LLM) fine-tuned for generating robust, industrial-grade unit tests across multiple programming languages. Built upon Qwen2.5-Coder-7B-Instruct and fine-tuned using Unsloth, this model is optimized for logic reasoning, edge-case detection, and mock architecture simulation.
This repository contains the 4-bit Quantized (GGUF - Q4_K_M) version, designed to run efficiently on consumer hardware (e.g., NVIDIA RTX 3070, 8GB VRAM) with minimal performance loss compared to the FP16 baseline.
๐ Key Features
- Resource Efficient: Runs on ~4.5 GB of VRAM/RAM.
- Polyglot Capabilities: Master-level performance in C, Java, Go, Python, C++, JavaScript, and even ROS2.
- Advanced Reasoning: Capable of handling complex scenarios like:
- Memory Safety (Null pointer checks in C).
- Concurrency (Goroutines/WaitGroups in Go).
- Reflection & Retry Logic (Java).
- Async/Promise Mocking (JavaScript/Jest).
- ASTER Methodology: Trained with principles inspired by Automated Software Testing & Error Remediation, focusing on compilability and behavioral correctness.
๐ Performance Evaluation
The model has been rigorously tested across various programming languages and complex testing scenarios. Below is the updated summary of its performance:
<details> <summary>๐ Click to Show All Training Data (Log)</summary>
</details>
๐ป Usage
Prompt Format (ChatML)
This model uses the ChatML template. Strict adherence to this format is recommended for optimal results.
<|im_start|>system
You are an expert software tester. Your goal is to write a comprehensive unit test.<|im_end|>
<|im_start|>user
Instruction:
Write a unit test for the following [Language] code...
Input:
[Source Code Here]
<|im_end|>
<|im_start|>assistantRunning with LM Studio / Ollama
- Download the
.gguffile from this repository. - Load it into your preferred GGUF runner (LM Studio, Ollama, etc.).
- System Prompt: Set the system prompt to: "You are an expert programmer and unit test generator."
- Context Window: Recommended set to
4096or8192.
Running with Python (llama-cpp-python)
from llama_cpp import Llama
llm = Llama(
model_path="./unit-test-model-q4_k_m.gguf",
n_ctx=4096,
n_gpu_layers=-1, # Offload all layers to GPU
verbose=False
)
prompt = """<|im_start|>system
You are an expert unit test generator.<|im_end|>
<|im_start|>user
Write a Python unit test for a function that divides two numbers.<|im_end|>
<|im_start|>assistant"""
output = llm(
prompt,
max_tokens=1024,
stop=["<|im_end|>"],
echo=False
)
print(output['choices'][0]['text'])โ ๏ธ Limitations & Bias Python Imports: In very complex Python scenarios involving obscure libraries, the model might occasionally miss an import statement or hallucinate a mock path.
Context Window: While optimized, extremely large source code files might exceed the context window. It is recommended to test modular functions or classes.
Self-Healing: For dynamic languages (Python, JS), we recommend using this model in a "Self-Healing" loop (Execution -> Error Capture -> Repair) for 100% reliability.
๐ License This model is a fine-tune of Qwen2.5-Coder and is licensed under Apache 2.0.
๐ค Acknowledgments Fine-tuned using Unsloth (2x faster training).
Base model by Qwen Team.
Dataset curated for ASTER (Automated Software Testing & Error Remediation) research.
