🚀 Why writing tests changed how I develop software While working on my latest Python project, I reached a point where adding new features started to feel risky. Not because the logic was complex — but because I could no longer be 100% sure that new changes wouldn’t break existing behavior. That’s where testing stopped being “optional” and became a necessity. By writing unit tests and integration tests: • I fixed a clear target for how my system should behave • I gained confidence to refactor and improve the code • I caught database, schema, and edge-case issues before they became real problems Without tests, development feels like moving forward without knowing whether you’re still on the same page as yesterday. With tests, every change is anchored to a shared and verifiable truth. This part of the project reminded me that tests are not just about finding bugs — they are about maintaining direction, consistency, and trust in your own system. 🐍 Python · SQLAlchemy · Pydantic · Pytest #SoftwareEngineering #Python #Testing #BackendDevelopment #LearningByBuilding
Hasan Erdin’s Post
More Relevant Posts
-
FastAPI feels like the most “productive + correct” way I’ve found to build REST APIs in Python. What stands out is how quickly you get a solid baseline: clear endpoint definitions, type hints that double as validation, and automatic OpenAPI docs that make it easy to test and share an API without extra tooling. For a student building small backend projects, that feedback loop matters. I spend less time wiring boilerplate and more time thinking about data models, error handling, and how the API should behave under edge cases. I’m curious: when you evaluate a backend framework, what matters more to you—performance, developer experience, or documentation quality?
To view or add a comment, sign in
-
-
Hey there! 😄 If you’ve ever used Mayapy (Maya’s embedded Python) or Hython (Houdini’s embedded Python) to run operations in scenes in batch mode, you know how frustratingly slow it can be to repeatedly initialize the interpreter. Whether you're writing unit tests, running automation, or building standalone tools that load multiple scenes, each startup adds unnecessary overhead. To solve this pain point, I built something that might help you: a TCP-based hot-reload server that keeps a persistent Mayapy or Hython process running in the background. Instead of launching the interpreter from scratch for every script execution, this service allows you to: ✨ Keep the DCC process alive — no more repeated startup time 📡 Connect over TCP and send Python snippets dynamically 🐍 Execute code in the live interpreter context, inside the currently loaded scene 🔄 Keep state between calls (e.g., imported modules, loaded scenes, global variables) 🔌 Close or reuse the connection depending on your needs Right now it supports both Mayapy and Hython, and the architecture makes it easy to extend to other embedded Python environments too. If you’re building automation tooling, test suites, or interactive Python-driven pipelines for Maya/Houdini, this might save you a lot of time. Check it out: 👉 https://lnkd.in/gGcUy7Xu Let me know what you think — feedback and contributions are welcome! 🙌 #Maya #Houdini #Python #Tooling #DCC #Development #OpenSource
To view or add a comment, sign in
-
Just give me your 5 minutes, I’ll save your next 5 hours. You’ll have a great understanding of function once you touch the end. Let me take you on a trip to Functions in Python. A function allows you to group a set of instructions together, give that group a name, and then trigger those instructions whenever needed by using that name. • Definition: You define a function using the def keyword in Python. • Execution: The code inside the function doesn't run automatically; it waits until you "call" or "invoke" it. • Input/Output: Functions can take inputs (called arguments) and send back results (using the return statement). Advantages of Functions: Using functions is a core principle of "Clean Code" and "DRY" (Don't Repeat Yourself) programming. Here are the key advantages: 1. Code Reusability This is the most significant benefit. Instead of writing the same 10 lines of code every time you need to calculate a result, you write it once in a function and call it ten times. This saves time and reduces the size of your program. 2. Modularity and Organization Functions help break a large, complex problem into smaller, manageable "modules". This makes the logic of your program much easier to follow because you can look at the function names to understand what each part of the code is doing. 3. Easier Debugging and Maintenance If there is an error in a specific calculation, you only have to fix it in one place—inside the function. If you didn't use functions, you would have to search through your entire code and fix every instance where that calculation was performed. 4. Improved Readability Code that uses well-named functions (like calculate_total_marks() or send_email()) reads almost like English. This makes it easier for you and other developers to understand the "intent" of the code without getting bogged down in the technical details. 5. Abstraction Functions allow you to use complex logic without needing to know how it works every single time. For example, you use the print() function in Python constantly; you don't need to understand how Python talks to your computer's screen hardware, you just need to know how to call the function when it requires. #Day49 of Documenting my Learnings & Building Meaningful Connections on LinkedIn.
To view or add a comment, sign in
-
-
Day 15 of My Python Full-Stack Journey 🐍 | Nested If Statements When I first looked at nested if statements, I thought — why would anyone put an if inside another if? Then I tried to build real logic. And it all made sense. Nested if statements are essentially decision trees in code. The outer condition acts as a gatekeeper, and only when it passes do you dive deeper into more specific conditions. It mimics how we actually think as humans. A simple example that clicked for me: python age = 20 has_id = True if age >= 18: if has_id: print("Access granted") else: print("ID required") else: print("You must be 18 or older") The outer if checks age. The inner if checks for ID. Neither alone tells the full story — but together, they handle the real world scenario perfectly. What I learned today: Nesting adds precision, but it also adds complexity. The deeper you nest, the harder it becomes to read and debug. That's why experienced developers often refactor deeply nested logic using logical operators (and / or) or early returns to keep code clean. It's Day 15 and I'm already seeing how programming forces you to think in layers — just like real-life decision making. The journey continues. 💻 #Python #FullStack #100DaysOfCode #PythonJourney #Day15 #CodingJourney #Beginners #Programming #NestedIf #LinkedInLearning
To view or add a comment, sign in
-
-
Why you should try uv in your Python projects💡 Some time ago, my colleague Pavel introduced uv into our test framework project as an alternative to the traditional pip + requirements.txt workflow. At first, I was skeptical because Python already has no shortage of dependency management tools. Around the same time, I was taking a Python bootcamp and decided to evaluate uv in practice. When it helped me resolve library version conflicts, I was genuinely impressed. What uv actually is uv is a modern Python package manager and dependency resolver, implemented in Rust. Its goal is not to reinvent Python tooling, but to address long-standing issues many teams face at scale. In particular, uv resolves dependency version conflicts and ensures reproducible environments through a lockfile-based approach, both locally and in CI. For teams still relying on the classic pip install -r requirements.txt workflow, uv is worth evaluating, especially if your dependency list is growing and performance matters. At this point, uv has become my default choice for Python projects, and I'd strongly recommend giving it a try if you haven't already. Today, I use uv in our test framework at work, in my Django finance pet project, and in my current course, "AI Engineer Agentic Track: The Complete Agent & MCP Course", and I plan to continue applying it in future projects and learning experiences. #Python #uv #package_manager
To view or add a comment, sign in
-
-
🚀 Starting Your Coding Journey? Begin with Python! If you’re just entering the tech world, Python is the perfect first step. Why? Because it’s: ✅ Simple & easy to read ✅ Beginner-friendly ✅ Super versatile (Web, Data, AI, Automation—you name it!) Here’s a roadmap to get started with Python 🐍👇 🔹 Step 1: Learn the Basics Variables & Data Types If/Else, Loops Functions 🔹 Step 2: Understand Data Structures Lists, Tuples, Dictionaries, Sets String Manipulation List Comprehensions 🔹 Step 3: Build Mini Projects Calculator App To-Do List Weather App (using APIs) 🔹 Step 4: Explore Real-World Applications Web Development (Flask/Django) Data Analysis (Pandas/Numpy) Automation (Selenium, Scripts) 🎯 Pro Tip: Don’t rush the process. Code daily. Break things. Learn by doing. 👉 Follow Kotha NandaKumari for more beginner-friendly tech content! #Python #CodingJourney #PythonForBeginners #LearnToCode #100DaysOfCode #ProgrammingTips3
To view or add a comment, sign in
-
A subtle Python behavior silently broke my backend — no errors, no logs. I was debugging a Frappe app where: • One user changed a setting • Another user started seeing the same change No exception. No traceback. Just wrong state. The culprit wasn’t Frappe. It was Python object mutability + caching. In Python: • Variables don’t hold data — they reference objects • Mutable objects (dict, list) can be shared unintentionally • When a cached mutable object is modified inside a request, you’re not changing “your copy” — you’re changing shared state That’s how: • User preferences leak across requests • Feature flags behave randomly • Bugs appear without throwing errors A real example: A global config dict was cached for performance. One request updated a flag for User A. User B hit the same endpoint — and saw User A’s behavior. No crash. Just incorrect logic. The fix wasn’t complex: • Don’t cache mutable objects globally • Use user-specific cache keys • Or return defensive copies This wasn’t about syntax. It was about how Python works under the hood. Python backend issues that don’t throw errors, but break systems quietly. #Python #BackendEngineering #SystemsThinking
To view or add a comment, sign in
-
𝗦𝘁𝗼𝗽 𝘄𝗿𝗶𝘁𝗶𝗻𝗴 𝗰𝗼𝗱𝗲 𝘁𝗵𝗮𝘁 𝗼𝗻𝗹𝘆 𝘄𝗼𝗿𝗸𝘀 𝘄𝗵𝗲𝗻 𝘁𝗵𝗶𝗻𝗴𝘀 𝗮𝗿𝗲 𝗽𝗲𝗿𝗳𝗲𝗰𝘁. 🛑 In my latest deep dive into Python, I shifted my focus from logic to resilience. It’s one thing to build a script that works in a "perfect world," but the real world is messy. Users type text into number fields. Files go missing. Servers go down. If your code isn't prepared for the "tire burst," it’s going to crash. 💥 In my latest Python Essentials series, I explored how to move beyond basic scripts by mastering Exceptions and Custom Error Handling. 𝗞𝗲𝘆 𝗧𝗮𝗸𝗲𝗮𝘄𝗮𝘆𝘀: • 𝗧𝗵𝗲 𝟯 𝗣𝗶𝗹𝗹𝗮𝗿𝘀 𝗼𝗳 𝗘𝗿𝗿𝗼𝗿𝘀: Understanding the difference between a Syntax Error, a Runtime Exception, and the "silent" Logical Error. • 𝗧𝗵𝗲 𝗦𝗮𝗳𝗲𝘁𝘆 𝗡𝗲𝘁: How to use try-except-else-finally blocks to catch unpredictable issues before they crash your program. • 𝗘𝗻𝗳𝗼𝗿𝗰𝗶𝗻𝗴 𝗕𝘂𝘀𝗶𝗻𝗲𝘀𝘀 𝗥𝘂𝗹𝗲𝘀: Why I create Custom Exceptions (like InsufficientBalanceError) to protect my "Rules" rather than just relying on technical failures. • 𝗧𝗵𝗲 𝗣𝗿𝗼𝗳𝗲𝘀𝘀𝗶𝗼𝗻𝗮𝗹 𝗘𝗱𝗴𝗲: Why return is stronger than break, and how 4-space indentation is the key to clean, surviving code. 𝗧𝗵𝗲 𝗗𝗲𝘃𝗲𝗹𝗼𝗽𝗲𝗿 𝗠𝗶𝗻𝗱𝘀𝗲𝘁 𝗦𝗵𝗶𝗳𝘁: I stopped asking, "Where should I use try?" and started asking, "Where can something go wrong?" That shift is the difference between a fragile script and a professional tool. Are you still writing code for a perfect world, or have you started building for the real one? 𝗖𝗵𝗲𝗰𝗸 𝗼𝘂𝘁 𝘁𝗵𝗲 𝗳𝘂𝗹𝗹 𝗯𝗿𝗲𝗮𝗸𝗱𝗼𝘄𝗻 𝗵𝗲𝗿𝗲: 🔗 https://lnkd.in/dZ6KwFVx #Python #Programming #CleanCode #ErrorHandling #SoftwareEngineering #PythonEssentials #Automation #CodingTips #VAULT
To view or add a comment, sign in
-
Unfurl, Debug Mode Activation Vulnerability (Critical) How the Vulnerability Works The vulnerability exists in how the Unfurl web application processes its debug configuration. The `web_app()` function in `unfurl/app.py` reads the `debug` setting from the `unfurl.ini` configuration file via config['UNFURL_APP'].get('debug'). This value is always retrieved as a string. This string is then passed directly, without type conversion, to the Flask application's `app.run(debug=unfurl_debug)` method. In Python, a non-empty string (like…...
To view or add a comment, sign in
-
Unfurl, Debug Mode Activation Vulnerability (Critical) How the Vulnerability Works The vulnerability exists in how the Unfurl web application processes its debug configuration. The `web_app()` function in `unfurl/app.py` reads the `debug` setting from the `unfurl.ini` configuration file via config['UNFURL_APP'].get('debug'). This value is always retrieved as a string. This string is then passed directly, without type conversion, to the Flask application's `app.run(debug=unfurl_debug)` method. In Python, a non-empty string (like…...
To view or add a comment, sign in
Explore related topics
- Advantages of Unit Testing for Software Development
- Integrating Testing During Software Development Phases
- Impact of Testing on Software Development Practices
- Improving Unit Tests for Consistent Code Quality
- How Developers can Improve Testing Practices
- The Role of Testing in Software Development
- Minimizing Unit Test Rewrites During Code Changes
- How to Understand Testing in the Development Lifecycle
- Why LLM Code Needs More Than Unit Tests
- Importance of Passing Tests When Refactoring Code
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