Unpopular opinion: I don't aim for 100% test coverage. Instead, I write tests where it matters most — after something breaks in production. Every incident becomes a test case. Every edge case that slipped through becomes a regression test. After 10 years, this approach has given me: - A test suite that catches real bugs, not theoretical ones - 40% less time writing tests nobody triggers - Confidence where it actually counts Perfect coverage is a vanity metric. Meaningful coverage is a survival strategy. How do you decide what to test? #SoftwareTesting #BackendEngineering #Python #ProductionEngineering
Indra Nand Jha’s Post
More Relevant Posts
-
In 𝗙𝗮𝘀𝘁𝗔𝗣𝗜, 𝗿𝗲𝘁𝘂𝗿𝗻 𝘁𝘆𝗽𝗲 and 𝗿𝗲𝘀𝗽𝗼𝗻𝘀𝗲_𝗺𝗼𝗱𝗲𝗹 describe the success body: a single Pydantic model, or a list of that model—whatever the handler returns on a normal 2xx. When a lookup fails or a rule is broken, you raise 𝗛𝗧𝗧𝗣𝗘𝘅𝗰𝗲𝗽𝘁𝗶𝗼𝗻 so the client gets a proper 𝟰𝘅𝘅 𝘀𝘁𝗮𝘁𝘂𝘀 and a 𝗱𝗲𝘁𝗮𝗶𝗹 𝗽𝗮𝘆𝗹𝗼𝗮𝗱. That is separate from the return type, because raise is not return. 𝗿𝗲𝘀𝗽𝗼𝗻𝘀𝗲_𝗺𝗼𝗱𝗲𝗹 defines how the 𝘀𝘂𝗰𝗰𝗲𝘀𝘀 𝗿𝗲𝘀𝗽𝗼𝗻𝘀𝗲 is built and documented; HTTPException is how you answer with an error without faking a 200. 👉 Detailed breakdown here: https://lnkd.in/gcySJqZX 👉 Code Here: https://lnkd.in/gyf4663s #FastAPI #Python #API #BackendDevelopment #SoftwareEngineering #Pydantic #OpenAPI
To view or add a comment, sign in
-
Reorder List: Three-Phase In-Place Transformation Creating new list costs O(n) space. In-place approach: (1) find middle with slow/fast pointers, (2) reverse second half, (3) interleave both halves. Three independent phases keep logic clean while achieving O(1) space. Phase Decomposition: Breaking complex transformation into three known patterns (find middle, reverse, merge) simplifies implementation and debugging. Each phase is independently testable. Time: O(n) | Space: O(1) #LinkedList #InPlaceTransformation #PhaseDecomposition #ThreePointers #Python #AlgorithmDesign #SoftwareEngineering
To view or add a comment, sign in
-
-
🗂️ HashMap pattern: the fastest way to improve a solution 💡 If you see 'find pair', 'count', or 'seen before' — think HashMap. Why this matters: - Turn nested loops into O(n) with a HashMap — and explain it cleanly. This topic appears repeatedly in interviews and real projects, so depth matters. 📌 If you want, I'll post a 'HashMap patterns' list with example problems. #dsa #algorithms #interviewprep #python #coding
To view or add a comment, sign in
-
-
Reorder Linked List: Split, Reverse, Merge Pattern Reordering a linked list looks tricky at first, but it becomes clean once you break it into three deterministic steps: Find the middle Reverse the second half Merge both halves alternately The key insight is: instead of trying to rearrange nodes in one pass, decompose the problem into simpler sub-problems you already know how to solve efficiently. Complexity: Time: O(n) | Space: O(1) Takeaway: Many linked list problems follow a hidden pattern: 👉 Split → Transform → Merge Once you recognize this, problems like palindrome check, reorder list, and even some cycle-based problems become much easier. #LinkedList #TwoPointers #InPlaceAlgorithms #CodingInterview #ProblemSolving #Python #SoftwareEngineering
To view or add a comment, sign in
-
-
🚀 Solved: Find a String (Substring Count) Challenge Just solved another problem on HackerRank under the Python Strings section! ✅ 🧠 Problem Overview: Count how many times a substring appears in a string — including overlapping occurrences. 🔍 Key Learnings: Practiced string traversal techniques Understood why built-in methods like count() may not always work (no overlapping support) Strengthened concepts of slicing and iteration in Python 💡 Example Insight: For string "ABCDCDC" and substring "CDC", the answer is 2 (overlapping counts matter!). ⚡ Approach Used: Iterated through the string Compared substrings using slicing Counted valid matches efficiently 📈 Problems like this help build strong fundamentals in string manipulation, which is crucial for coding interviews and real-world applications. #Python #HackerRank #Coding #Strings #ProblemSolving #DSA #LearningJourney #AI link of #Solution :- https://lnkd.in/gtqcy8fX
To view or add a comment, sign in
-
-
I've been using AI agents every day for months without actually understanding how they work. A cracked friend built a tool that breaks the whole thing down. No frameworks. ~60 lines of Python. Turns out an agent is just a function. Tools are a dict. Memory is a tool that writes to a file. That's it. Went through all 9 lessons in one sitting. If you've been using LangChain or CrewAI without knowing what's underneath, honestly just start here first. #AIAgents #SoftwareEngineering #BuildingInPublic
To view or add a comment, sign in
-
💡 Solved Group Anagrams today! 🧠 Key idea: Instead of comparing strings, I used a frequency array (size 26) to create a unique key for each word. ⚠️ Catch in constraints: All characters are lowercase English letters, which allows us to use a fixed-size array of 26 for efficient hashing. 🚀 Result: Achieved O(n · k) time complexity. Great example of converting a comparison problem into a hashing problem! #LeetCode #DSA #Algorithms #Python #CodingInterview
To view or add a comment, sign in
-
-
The Shortcut That Became Your Default A quick fix. Skipping validation. Hardcoding values. Copying old logic without questioning. A faster way to get results. The steps you skipped writing down never got documented. “I’ll fix this later,” you told yourself. It felt temporary. But you didn’t fix it and days later the logic was already forgotten. And soon, it became the default—quietly shaping your process. 👉 Shortcuts don’t fail in isolation. They quietly build a system that works—until it doesn’t. 👉 In data work, shortcuts rarely stay short-term. #DataAnalytics #Python #LearningInPublic #AnalyticsThinking
To view or add a comment, sign in
-
Just solved a classic DSA problem: Valid Parentheses Check using a stack! This problem is a great example of how a simple concept like a stack can help solve real interview-level questions efficiently. In the video, I walk through the logic step-by-step and implement it in Python in a clean and beginner-friendly way. If you're preparing for coding interviews or strengthening your DSA fundamentals, this one is definitely worth your time. 🎥 Check out the full explanation in the given link. Would love to hear how you approached this problem or if you have alternative solutions! #datastructures #algorithms #python #codinginterview #softwareengineering #learning #dsa https://lnkd.in/g8AdYW6J
2. Check for Balanced Parentheses (Python) | DSA 💻 - PRACTICE PROBLEM
https://www.youtube.com/
To view or add a comment, sign in
-
Started moving from learning syntax to actually building logic. 🚀 Project: Number Guessing Game in Python Built an interactive game where the system generates a random number and provides hints (higher/lower) until the correct guess is made. 🔹 Concepts applied: • Random module • While loop for continuous interaction • Conditional logic (if-elif-else) • Attempt tracking 💡 Key learning: Even a simple project highlights the importance of writing correct logic and thinking step by step to improve user interaction. 📌 Focusing on consistency and improving with every project. #Python #CodingJourney #BeginnerProjects #ProblemSolving #100DaysOfCode
To view or add a comment, sign in
-
More from this author
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development