AI in software engineering and low-code platforms
Overview of how AI (especially generative models and ML) helps software engineering tasks and how low-code platforms change development, with definitions, key concepts, formulas, worked examples, exam pointers and quick checks.
Drafted with Aria, reviewed by the AiCanCode.org team · Updated . How we write and check our notes. Spotted an error? Use Give Feedback at the bottom of the page.
Why it matters
AI tools (like code-completion models, test generators and bug detectors) speed up developer tasks, reduce routine work and help find defects earlier. Low-code platforms let teams build business software faster by using visual models and pre-built components — this matters when deadlines and cost constraints are strict.
Key ideas
- Generative AI: models that produce new artifacts (text, code, images). Example: large language models (LLMs) that generate code from prompts.
- Large Language Model (LLM): a neural network trained to predict the next token in large text corpora. It can be used for code completion and generation.
- Prompt engineering: designing input text (prompt) to get better outputs from an LLM. A prompt is a specification of context and the task.
- Precision, Recall, F1: evaluation metrics used for classification tasks (e.g., vulnerability detection). Precision = fraction of reported positives that are true; Recall = fraction of actual positives found. F1 = harmonic mean of precision and recall.
- Perplexity and Cross-Entropy: measures for language models. Cross-entropy measures how well the model's probability distribution q predicts true distribution p. Perplexity = 2^(cross-entropy) for base-2 logs; lower is better; with natural logs, Perplexity = exp(cross-entropy).
- Model evaluation in software engineering: for code generation you may use BLEU/ROUGE (n-gram overlap), exact match, compilation rate, test-pass rate and human assessment. Also report CodeBLEU and pass@k for code tasks, and prefer execution-based or test-pass metrics when possible. For bug detectors use precision/recall and include PR/ROC curves with AUC if applicable; for code completion use exact token accuracy and in-IDE suggestion acceptance rate.
- Naive Bayes classification (short derivation and assumptions):
- Definition: classifies an input x into class c that maximizes P(c|x). The decision rule becomes c* = argmax_c P(c) ∏_i P(x_i|c) since P(x) cancels; for continuous features, Gaussian Naive Bayes models P(x_i|c) with N(μ_ci, σ_ci^2).
- By Bayes' theorem P(c|x) = P(x|c)P(c)/P(x). Naive Bayes assumes conditional independence of features given class: P(x|c) = ∏_i P(x_i|c).
- That assumption simplifies estimation from data but is usually false; still Naive Bayes often works well in practice.
- How LLMs are used in SE workflows:
- Code completion inside IDE (reduce typing time).
- Generating unit tests and test inputs (increase coverage quickly).
- Summarising code and writing documentation (help requirements and maintenance).
- Automated code review suggestions and fix proposals (assist reviewers but not replace them).
- Generating deployment scripts or CI config (speeds DevOps).
- Low-code platforms:
- Definition: development environments that use visual models, drag-and-drop components and pre-built connectors to reduce manual coding.
- No-code is a stricter form aimed at non-programmers.
- Model-driven development: the application behavior is specified by models (e.g., workflows, schemas) which the platform transforms into executable code.
- Connectors: pre-built adapters to databases, APIs and cloud services.
- Scaffolding and templates: pre-made UI and logic blocks.
- Extensibility: advanced platforms allow custom code when needed.
- Benefits of low-code for engineering teams: faster prototyping, lower entry barrier for domain experts, standardised integrations, reduced routine coding.
- Risks and governance: vendor lock-in, security and compliance gaps, difficulty with complex or high-performance requirements, hidden technical debt. Governance must include versioning, access control, and testing policies; address data privacy/IP leakage when using LLMs, prompt injection and supply-chain risks, require audit logging and environment segregation (dev/test/prod), perform dependency/license compliance checks for generated code, and define rollback procedures.
Drawings to make for exams (describe exactly):
- Architecture diagram of a low-code platform: draw three vertical layers labeled (top) UI / Workflow Designer, (middle) Runtime Engine / Business Logic, (bottom) Data Connectors / Persistence. Add arrows: Designer -> Runtime (model deployment), Runtime -> Data Connectors (IO), and annotate where user custom code plugs in.
- LLM integration flow in CI pipeline: draw boxes left-to-right: Developer IDE -> LLM code-suggester (optional) -> Commit to VCS -> CI pipeline with LLM-based test-generator -> Test runner -> Deploy. Label decisions where human review is required.
Assumptions to state in answers: when evaluating ML models assume test data is independent and identically distributed (IID) from the real distribution unless stated otherwise; also state that there is no train–test contamination/data leakage; when using low-code, assume the platform provides secure connectors unless told otherwise.
Formulas
P(c|x) = P(x|c) * P(c) / P(x) where P(c|x) is posterior probability of class c given input x, unitless, applies always; denominator P(x) normalises.
P(x|c) = ∏_i P(x_i|c) (Naive Bayes assumption: features x_i conditionally independent given c), unitless, applies under the independence assumption.
Precision = TP / (TP + FP) TP=true positives, FP=false positives, unitless (ratio), applies to binary classification.
Recall = TP / (TP + FN) FN=false negatives, unitless (ratio).
F1 = 2 * (Precision * Recall) / (Precision + Recall) harmonic mean, unitless.
CrossEntropy = - (1/N) * Σ_{i=1..N} log q(y_i | x_i) q = model distribution, y_i true token, applies for language model loss, log natural unless specified.
Perplexity = exp(CrossEntropy) unitless; lower means better predictive power.
Cost_saved = (T_manual - T_lowcode) * C where T_manual = manual developer-hours, T_lowcode = developer-hours with low-code, C = cost per developer-hour (currency/hour). Use SI units: hours (h), currency as INR or $ as stated.
Syntax to remember for prompts (short patterns students should know):
- Instruction style: "You are a helpful coding assistant. Rewrite the function below to be more efficient, keep behaviour: <code>...</code>"
- Few-shot format: provide 1–3 example input-output pairs, then the new input.
- Safety pattern: always request "explain changes" and "provide tests" in the prompt, and set temperature=0 (deterministic) for CI use.
Worked examples
- Evaluation metrics (numerical) Given: a bug detector on 1000 code snippets reports: TP=80, FP=20, FN=30, TN=870. Compute Precision, Recall, F1. Steps:
- Formula:
Precision = TP / (TP + FP)= 80 / (80 + 20) = 80 / 100 = 0.8. - Formula:
Recall = TP / (TP + FN)= 80 / (80 + 30) = 80 / 110 ≈ 0.72727. - Formula:
F1 = 2 * (P * R) / (P + R)= 2 * (0.8 * 0.72727) / (0.8 + 0.72727) = 2 * 0.581816 / 1.52727 ≈ 1.163632 / 1.52727 ≈ 0.7627. Answer: Precision = 0.8 (80%), Recall ≈ 0.727 (72.7%), F1 ≈ 0.763 (76.3%). Final: Precision = 0.8, Recall ≈ 0.727, F1 ≈ 0.763.
- Low-code time saving (numerical) Problem: A feature normally needs 120 developer-hours. Low-code reduces manual work by 60%. Developer cost C = INR 500/hour. Compute time and cost saved. Steps:
T_lowcode = 120 * (1 - 0.60) = 48 h.Hours saved = 120 - 48 = 72 h.Cost_saved = 72 h * 500 INR/h = 36,000 INR. Answer: 72 hours saved, 36,000 INR saved.
- LLM-based code-fix trace (algorithmic / step trace) Task: Use an LLM to fix a buggy function that reverses a string but returns null on empty input. Steps to trace (what examiner expects):
- Prepare prompt: include function code, error description, desired behaviour and a unit test.
- LLM returns candidate fix (e.g., check for null/empty and return "" for empty).
- Post-process: run static checks (lint), run unit test. If test passes, propose commit message.
- Human reviews and approves or modifies. If modified, re-run tests.
Show example snippet the examiner expects: original code, proposed patch, unit test, and test-result line:
All tests passed. This shows understanding of integration and verification steps, not just the model output.
Common mistakes
- Assuming Naive Bayes independence holds; forget to state it as an assumption.
- Ignoring platform limitations: claiming low-code always reduces cost without accounting for vendor fees, customization overhead and hidden integration work.
- Over-trusting metrics like BLEU for code quality: BLEU measures token overlap, not semantic correctness or compilability.
- Not including governance steps (versioning, rollback, access control) when proposing LLM or low-code in production.
For your exam
Typical question types:
- Definitions and short notes: define AI/ML/LLM, low-code, pros and cons, prompt engineering.
- Diagram questions: draw low-code architecture or LLM integration in CI/CD.
- Derivations: derive Bayes' theorem and show Naive Bayes formula and assumptions.
- Numericals: compute precision/recall/F1, cost savings, perplexity from cross-entropy value.
- Short programming/trace: show how you integrate an LLM into a review pipeline and how you test generated patches. What a full-marks answer includes:
- Clear definitions with bold term usage and assumptions stated.
- For derivations: each algebra step (for Bayes start from joint probability P(c,x) and show rearrangement), final formula and comment on assumptions.
- For diagrams: labeled boxes and arrows with brief explanations of components.
- For numericals: write formula, substitute numbers with units where appropriate, show intermediate steps, final answer in bold and units.
- For open problems (e.g., adopt AI in a team): give benefits, risks and a short rollout plan including governance and testing.
Quick check
- What is the Naive Bayes conditional independence assumption?
- Give the formula for F1 score in terms of precision and recall.
- Name two governance risks when adopting low-code platforms. Answers: 1) Features x_i are conditionally independent given the class c: P(x|c)=∏_i P(x_i|c). 2) F1 = 2*(Precision*Recall)/(Precision+Recall). 3) Vendor lock-in and hidden security/compliance gaps.
Finished this topic? Mark it so your progress, study plan and readiness keep up.
Stuck on something here?