Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 5

Evaluating Project Directions: Data, Complexity, and Impact

Recommended resources

Welcome! This is the final lesson in our first module, "Foundations: ML for Software Quality." In the previous lesson, we framed your three project ideas as distinct machine learning problems: classification, ranking, and generation. That was the "what." Now, we'll focus on the "which."

The goal of this lesson is to give you a clear, practical framework for comparing these three project directions. By the end, you'll have a much better sense of which project best aligns with your learning goals, technical interests, and the kind of tool you want to build for your portfolio.

Specifically, you will learn to:

  • Compare the three project directions based on data requirements, implementation complexity, and potential impact.

We'll analyze each project through these three lenses, giving you the information you need to make an informed decision as we move into the hands-on modules.


The Three Lenses of Comparison

To make a good decision, we need to evaluate each project idea against a consistent set of criteria. We'll use the following:

  1. Data Requirements: What kind of data does the model need? How difficult is it to collect and label this data? This is often the single biggest challenge in any ML project.
  2. Implementation Complexity: What does it take to build a minimum viable product (MVP)? This includes the ML models you'd use, the libraries required (e.g., scikit-learn, TensorFlow, Transformers), and the overall engineering effort.
  3. Potential Impact: If you build this tool, how valuable would it be? We'll consider its potential to improve a software team's efficiency, reliability, and strategic decision-making.

Let's now apply these lenses to each project.



Project 1: Technical Debt Prioritization Tool

As we saw, this is primarily a ranking or classification problem. The goal is to build a tool that ingests a list of technical debt items and intelligently sorts them by urgency.

Technical Debt Prioritization Framework
This framework illustrates the core idea of a prioritization tool: combining multiple factors like severity and cost into a single score. An ML model learns to do this automatically.

1. Data Requirements

  • Data Sources: The raw data comes from sources you're familiar with:
    • Static analysis tools (e.g., SonarQube): To identify debt items and extract code metrics (complexity, duplication, code smells).
    • Version control (Git): To get code churn, change frequency, and author history.
    • Project management tools (e.g., Jira): To link code changes to bug reports or features.
  • The Bottleneck - Labeled Data: This is the project's biggest data challenge. For a supervised model to learn, it needs to know what a "high priority" item looks like. This ground truth typically comes from surveying experienced developers, which is time-consuming.

The PhD thesis we reviewed last lesson provides a blueprint for this. It details how the authors built a dataset by surveying developers about thousands of technical debt items.

Technical Debt Prioritization: Methods, Techniques, and a Large ...

Let's revisit the thesis 'Technical Debt Prioritization: Methods, Techniques, and a Large ...' by Diogo de Jesus Pina to understand the data collection effort.

Please read Chapter 6, 'Technical Debt Prioritization using Machine Learning' (pages 63-85). Focus on Sections 6.1.1 'Data Collection' and 6.1.2 'Data Preparation'. Notice how they used a survey to collect 2,616 labeled data points and then prepared them into different label types ('pay or not', '3-classes', etc.). This illustrates the process of creating the necessary labeled dataset.

The key takeaway is that while raw data is accessible, creating the labels for a technical debt prioritizer requires a significant, structured effort.

2. Implementation Complexity

  • ML Approach: The complexity here is quite manageable and maps well to your skills. You can start with a classical ML approach using models like Random Forest or XGBoost, which are available in scikit-learn. The thesis you just read about successfully used these exact types of models.
  • Core Task: The main work lies in feature engineering. You would write Python scripts to pull data from Git and a static analysis tool, combine them, and create features like change_frequency, author_count, and complexity_score. You would then feed this feature matrix into your classifier.
  • Difficulty: Low to Medium. This project is a fantastic way to deepen your practical Python, Pandas, and Scikit-learn skills. The ML modeling itself is not overly complex, but the data gathering and feature engineering are non-trivial.

3. Potential Impact

  • Value Proposition: The impact is High. Engineering teams are often overwhelmed by technical debt. A tool that helps them focus on the 20% of debt causing 80% of the pain is incredibly valuable. It turns an ambiguous problem into an actionable, data-driven strategy.

To get a sense of this value, let's look at how the industry views this problem.

Everything You NEED to Know About TECH DEBT

The video 'Everything You NEED to Know About TECH DEBT' by ForrestKnight quantifies the cost of technical debt and different methods for prioritizing it.

Watch the segment on the cost of tech debt (01:33 - 02:19), where he mentions teams spending up to 42% of their time dealing with it. Then, review the section on measuring and prioritizing debt (10:57 - 15:24), which discusses prioritization models like the 'three-factor model' and 'PAiD'. Your tool would automate this kind of analysis.

A tool that can automatically calculate and rank debt based on these factors would save significant time and help direct resources to where they matter most, directly improving development velocity.



Project 2: Flaky Test Detection Tool

This is a classification problem: given a test, is it flaky or not_flaky? This project sits squarely at the intersection of your QA and ML expertise.

1. Data Requirements

  • Data Sources:
    • CI/CD Logs: The primary source is your test execution history from tools like Jenkins, GitHub Actions, or CircleCI. You'd need to parse these logs to get pass/fail status, execution times, and error messages for each test over time.
    • Source Code: The content of the test files themselves.
  • The Bottleneck - Labeled Data: Similar to the tech debt project, getting reliable labels is hard. The "gold standard" for identifying a flaky test is to re-run it hundreds of times in isolation to see if its outcome changes. This is computationally expensive. Another approach is to rely on heuristics (e.g., a test that failed and then passed on a re-run is likely flaky) or use existing, publicly available datasets.

The research paper on FlakyXbert highlights how researchers leverage such datasets.

An Analysis of LLM Fine-Tuning and Few-Shot Learning for Flaky Test Detection and Classification

The paper 'An Analysis of LLM Fine-Tuning and Few-Shot Learning for Flaky Test Detection and Classification' provides context on data for this problem.

Read Section II-A, 'Flaky Tests' (starts on page 2). Pay attention to the description of the IDoFT and FlakyCat datasets. This shows that for research and initial development, you can start with pre-labeled data, which is a major advantage over the tech debt project.

While using an existing dataset accelerates initial development, a production-ready tool would need a pipeline to collect and label data from the specific project it's analyzing.

2. Implementation Complexity

  • ML Approach: This project offers a wider spectrum of complexity.
    • Classical ML: You could start with a scikit-learn classifier using features engineered from test execution history (e.g., fail_rate, duration_variance).
    • Deep Learning: For higher performance, you could move to deep learning models that analyze the test's source code directly. This could involve using pre-trained code models like CodeBERT to generate embeddings, which aligns with your experience in TensorFlow/Keras and interest in modern AI.
  • Core Task: The initial challenge is data parsing, as CI logs can be unstructured. If you choose the deep learning path, the complexity shifts to handling tokenizers, embeddings, and transformer models.
  • Difficulty: Medium to High. A classical ML version is comparable to the tech debt project. A deep learning version represents a significant step up in complexity, offering a great learning opportunity in applying cutting-edge NLP techniques to code.

3. Potential Impact

  • Value Proposition: The impact is Very High. Flaky tests are a notorious source of pain. They erode trust in the CI/CD pipeline, cause developers to ignore legitimate failures, and waste countless hours on debugging non-existent problems.
  • A reliable flake detection tool provides immediate, tangible value by:
    • Increasing confidence in automated testing.
    • Reducing time wasted on investigating false alarms.
    • Preventing flaky tests from masking real bugs.

This directly addresses a critical pain point in modern software quality assurance.



Project 3: AI-Powered Test Case Generation

This is a generation problem. The goal is not to predict a label but to create new content—executable test code—using a Large Language Model (LLM).

1. Data Requirements

  • Data Sources: The "data" here is different. You are not creating a large, labeled dataset for training. Instead, you are leveraging the knowledge of a massive, pre-trained model.
    • Code Context: The primary input is the code you want to test (a function signature, its docstring, its full source code).
    • Codebase Knowledge (for RAG): For more advanced generation, the model might need access to the entire codebase to understand dependencies and conventions. This is the "retrieval" part of Retrieval-Augmented Generation (RAG).
    • Few-Shot Examples: You may provide a few examples of well-written tests to guide the LLM's output style.
  • The Bottleneck: There is no traditional labeling bottleneck. The main "data" challenge is curating the right context to feed into the LLM prompt to get a high-quality output.

2. Implementation Complexity

  • ML Approach: This project is fundamentally different from the other two. It doesn't involve training a model from scratch. The complexity lies in LLM orchestration.
  • Core Task:
    1. Prompt Engineering: Designing precise, effective prompts that coax the LLM into generating correct and robust test code.
    2. API Integration: Interacting with LLM APIs from providers like OpenAI, Anthropic, or Hugging Face.
    3. RAG Pipeline (Optional but powerful): Building a system to retrieve relevant code snippets from a codebase, embed them, and inject them into the prompt as context. This often involves using vector databases.
  • Difficulty: Medium to High. While you don't train a model, building a robust RAG pipeline is a significant engineering task. This project path aligns perfectly with your stated interests in LLMs, RAG, and Agentic AI. It would put you at the forefront of a major trend in software engineering.
Automated Test Case Generation Architecture Diagram
This architectural diagram shows the components of an LLM-based generation system using RAG. The complexity lies in building this pipeline: preprocessing input, embedding data, retrieving context, and processing the LLM's output.

3. Potential Impact

  • Value Proposition: The impact is High, with a focus on developer productivity.
  • This tool can act as a powerful "copilot" for developers, automating the creation of boilerplate unit tests and freeing them up to focus on more complex integration and end-to-end tests. It can rapidly increase test coverage for new features.
  • Caveat: The quality of generated tests can be variable. They might be simplistic or miss subtle edge cases. The impact is maximized when the tool is seen as an assistant that produces a strong first draft, which is then reviewed and refined by a human developer.


Summary and Comparison

Let's bring it all together in a table to make the trade-offs clear.

Criterion Technical Debt Prioritization Flaky Test Detection Test Case Generation
Data Requirements Needs code metrics, Git history. Bottleneck: Getting developer-labeled data for what's "important." Needs CI/CD logs, source code. Bottleneck: Expensive process of running tests repeatedly to get "flaky" labels. Public datasets help. Needs source code & docstrings. No major labeling bottleneck. Relies on pre-trained LLM and codebase context (RAG).
Implementation Complexity Low to Medium. Classical ML (RandomForest). Focus on feature engineering. Uses skills you have: Python, pandas, scikit-learn. Medium to High. Can be classical ML or advanced Deep Learning (CodeBERT, FSL). Involves CI log parsing. A great way to apply your TF/Keras skills. Medium to High. Focus on LLM APIs, prompt engineering, and RAG pipelines. Aligns with your interest in cutting-edge AI.
Potential Impact High. Strategic value. Focuses team effort on what matters most, improving development velocity and reducing long-term maintenance costs. Very High. Tactical value. Directly improves CI/CD reliability and developer trust. Reduces time wasted on false alarms. High. Productivity value. Acts as a developer assistant, speeding up test creation and increasing coverage. Output requires human review.

Conclusion

You now have a structured overview of the trade-offs between your three potential projects. Each path offers a unique set of challenges and learning opportunities:

  • Technical Debt Prioritization is a solid choice for honing your skills in data engineering and classical machine learning on a well-understood, high-impact problem.
  • Flaky Test Detection offers a direct bridge between your QA and ML background, with the option to scale from classical ML to more advanced deep learning on code.
  • Test Case Generation is your opportunity to dive deep into the world of LLMs, RAG, and prompt engineering—a paradigm that is rapidly reshaping the field of AI.

There is no single "best" choice; the right one depends on which set of challenges and skills you find most exciting.

Preview of the Next Module:
In our next module, "Data Collection: Mining Software Repositories," we will start building the foundational components for these projects. Our first lesson will be "Extract commit history and code churn metrics from a Git repository using GitPython." This is a critical skill for both the technical debt and flaky test projects, and a useful data analysis skill in general. As you reflect on your choice, rest assured that the skills we learn next will be valuable no matter which direction you take.