Welcome to Unit 3. You now have the prompt engineering skills from Unit 2. This unit is about applying those skills to your actual work — starting with the role most of you are entering or preparing for: software development.
This module is not theoretical. Every technique here maps to a task you will encounter in your first week at TCS, Infosys, Wipro, HCL, or any Indian IT company — or in your current academic projects if you are still in college.
At Infosys, 28 million lines of code were generated using AI tools in FY26. At Accenture, teams using Copilot saw pull request time drop from 9.6 days to 2.4 days — a 4x acceleration. Code review turnaround improved by 67%.
This is not a future prediction. It is the current working environment at every major Indian IT company. Developers who use AI tools effectively are completing the same work in half the time. Those who do not are working twice as hard to keep up.
The most common developer use case. Give the AI enough context about your stack, constraints, and requirements and it will produce a working first draft in seconds. The key is specificity — the more precisely you describe what you need, the less cleanup you do afterwards.
Write a Django REST Framework view for a loan eligibility check endpoint.
Requirements:
Stack: Django 4.2, DRF 3.15, Python 3.11
For simpler functions — utility methods, data transformations, standard CRUD operations — GitHub Copilot inside VS Code is the fastest tool. It auto-completes as you type, with no prompt needed. For complex features like the one above, Claude or ChatGPT with a detailed prompt is more reliable.
Debugging is where AI saves the most time for junior developers. A bug that takes 45 minutes to trace manually often takes under 2 minutes with AI — if you provide enough context. The three things that matter: the error message, the code, and what you expected to happen.
Error: KeyError at /api/v1/portfolio/summary/ ’total_invested' File “/app/views/portfolio.py”, line 47, in get_portfolio_summary return Response({‘invested’: data[’total_invested’]})
My code (views/portfolio.py, lines 40-55): def get_portfolio_summary(request): user_id = request.user.id holdings = StockHolding.objects.filter(user_id=user_id) data = {} for holding in holdings: data[’total_value’] = data.get(’total_value’, 0) + holding.current_value data[’total_invested’] = data.get(’total_invested’, 0) + holding.purchase_price serializer = PortfolioSerializer(data) return Response({‘invested’: data[’total_invested’]})
Expected: Return the total invested amount for the user. Actual: KeyError on ’total_invested’ even though I set it in the loop.
Identify the bug, explain why it occurs, and provide the fix.
data['total_invested'] fails when holdings is an empty queryset (the loop never runs). Without the code and context, it would guess.Error message: [paste exact error or traceback]
Relevant code: [paste the function or section where the error occurs]
Context:
Stack: [language version, framework version, relevant libraries]
Identify the bug, explain why it occurs, and provide the corrected code.
In Indian IT service delivery, code review is a core part of every sprint. AI can act as a first-pass reviewer — catching issues before a senior engineer reviews it. This reduces review cycles, improves your code quality, and signals professionalism to your team lead.
Review this Python function and check for the following — respond in this exact format:
Code to review: def get_user_transactions(user_email): conn = sqlite3.connect(’transactions.db’) cursor = conn.cursor() query = “SELECT * FROM transactions WHERE email = ‘” + user_email + “’” cursor.execute(query) results = cursor.fetchall() return results
+ string concatenation.Test writing is the task developers hate most and AI handles best. Given a function, the model can generate unit tests covering normal cases, edge cases, and error conditions in seconds. At Wipro, 60+ GenAI use cases exist for software testing alone.
Write comprehensive unit tests for this Python function:
def validate_pan_number(pan: str) -> dict: “““Validates Indian PAN card number format. Format: 5 letters + 4 digits + 1 letter (e.g., ABCDE1234F) Returns: {‘valid’: bool, ’error’: str or None} "”” import re if not pan: return {‘valid’: False, ’error’: ‘PAN number is required’} pan = pan.upper().strip() pattern = r’^[A-Z]{5}[0-9]{4}[A-Z]{1}$’ if re.match(pattern, pan): return {‘valid’: True, ’error’: None} return {‘valid’: False, ’error’: ‘Invalid PAN format’}
Cover these test categories:
Use pytest. Use descriptive test function names. Include docstrings on each test.
Documentation is the task that almost never gets done properly and AI does extremely well. A well-prompted model will generate docstrings, README files, and API documentation that are consistent, complete, and formatted correctly — saving hours of work per sprint.
Include: summary line, Args section with types and descriptions, Returns section with type and description, Raises section for all possible exceptions, and one usage Example.
def calculate_sip_returns(monthly_investment: float, annual_rate: float, years: int) -> dict: months = years * 12 monthly_rate = annual_rate / 100 / 12 if monthly_rate == 0: total_value = monthly_investment * months else: total_value = monthly_investment * ( ((1 + monthly_rate) ** months - 1) / monthly_rate ) * (1 + monthly_rate) total_invested = monthly_investment * months total_returns = total_value - total_invested return { ’total_invested’: round(total_invested, 2), ’total_value’: round(total_value, 2), ’total_returns’: round(total_returns, 2), ‘return_percentage’: round((total_returns / total_invested) * 100, 2) }
Project: A FastAPI backend for an Indian stock portfolio tracker Stack: Python 3.11, FastAPI, PostgreSQL, Redis, Docker Features: User authentication (JWT), portfolio CRUD, real-time NSE price updates via WebSocket, profit/loss calculation, tax liability estimation (LTCG/STCG)
Include these sections in order:
Use GitHub Markdown formatting. Keep language professional but not corporate.
Here is how the best developers at Indian IT companies structure their AI usage — not using it for everything, but using it at the right points in the workflow:
This assignment builds your prompt library for development work. Each task should take 15–20 minutes.
After this assignment you will have concrete evidence of what AI can and cannot do for your development work — calibrated to your actual stack, not a generic tutorial example.
| Claim | Source |
|---|---|
| Developers complete tasks 55% faster with GitHub Copilot — tested with 4,800 developers | Quantumrun / companieshistory.com GitHub Copilot Statistics 2026 |
| GitHub Copilot generates 46% of all code written by active users; 88% code retention rate | aboutchromebooks.com / getpanto.ai GitHub Copilot Statistics Jan 2026 |
| 84% of developers use or plan to use AI tools in 2026 | index.dev Developer Productivity Statistics with AI Tools 2026 |
| Only 29–46% of developers trust AI-generated code without review; 46–68% report quality issues | index.dev Developer Productivity Statistics with AI Tools 2026 |
| Accenture: pull request time dropped from 9.6 to 2.4 days; 67% reduction in code review turnaround | wearetenet.com GitHub Copilot Usage Data Statistics 2025 |
| Infosys 28 million lines of AI-generated code | Infosys FY26 earnings commentary |
| Wipro 60+ GenAI use cases for software testing | Wipro 6-K SEC filing FY2025 |