<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Vijay Vyawhare on Medium]]></title>
        <description><![CDATA[Stories by Vijay Vyawhare on Medium]]></description>
        <link>https://medium.com/@vijayvyawhare?source=rss-5d631a053960------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*6hIxNc7AI32s20bg-LYfKA.png</url>
            <title>Stories by Vijay Vyawhare on Medium</title>
            <link>https://medium.com/@vijayvyawhare?source=rss-5d631a053960------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 09:11:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vijayvyawhare/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Building an AI-Powered Bug Detection System: From Concept to Production]]></title>
            <link>https://vijayvyawhare.medium.com/building-an-ai-powered-bug-detection-system-from-concept-to-production-e16986c16689?source=rss-5d631a053960------2</link>
            <guid isPermaLink="false">https://medium.com/p/e16986c16689</guid>
            <dc:creator><![CDATA[Vijay Vyawhare]]></dc:creator>
            <pubDate>Tue, 26 Aug 2025 04:20:06 GMT</pubDate>
            <atom:updated>2025-08-26T04:20:06.450Z</atom:updated>
            <content:encoded><![CDATA[<p><em>How we’re revolutionizing software quality with intent-driven validation and advanced ML</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HTXI_swgOPBcEAJxYcgr4Q.jpeg" /></figure><h3>The Problem: Why Traditional Bug Detection Falls Short</h3><p>Every developer knows the frustration: you write code that passes all tests, follows best practices, and looks clean — yet somehow, bugs still slip into production. Traditional static analysis tools catch syntax errors and basic issues, but they miss the fundamental problem: <strong>the gap between what your code does and what it’s supposed to do</strong>.</p><p>Consider this scenario: Your product manager writes a requirement like “Users should be able to reset their password only if they’ve verified their email.” Your code might look perfect:</p><pre>def reset_password(user_id: str, new_password: str) -&gt; bool:<br>    user = get_user(user_id)<br>    if user.email_verified:<br>        update_password(user_id, new_password)<br>        return True<br>    return False</pre><p>The code is syntactically correct, adheres to security practices, and includes proper error handling. But what if the business logic is wrong? What if users should only be able to reset passwords within 24 hours of verification? Traditional tools won’t catch this.</p><p><strong>This is where AI-powered intent detection comes in.</strong></p><h3>The Vision: Intent-Driven Code Validation</h3><p>Our system doesn’t just analyze code — it understands the <strong>intent</strong> behind your requirements and validates that your implementation matches that intent. Here’s how it works:</p><h3>1. Intent Processing Pipeline</h3><p>The core innovation is our intent processing pipeline that transforms natural language requirements into semantic models:</p><pre>class IntentProcessor:<br>    def __init__(self):<br>        # Using RoBERTa-large for superior language understanding<br>        self.document_analyzer = TransformerAnalyzer(model=&quot;roberta-large&quot;)<br>        self.domain_adapter = DomainAdapter()<br>        self.graph_builder = IntentGraphBuilder()<br>        <br>    async def process_document(self, doc: Document) -&gt; IntentGraph:<br>        # Generate embeddings from requirements document<br>        embeddings = await self.document_analyzer.encode(doc)<br>        <br>        # Adapt to technical domain (software requirements)<br>        domain_adapted = self.domain_adapter.adapt(embeddings)<br>        <br>        # Build semantic graph representing intent<br>        return self.graph_builder.build(domain_adapted)</pre><p>When you feed it a requirement like “Password reset requires email verification,” it creates a semantic graph:</p><pre>[Password Reset] --requires--&gt; [Email Verification]<br>[Email Verification] --implies--&gt; [User Authentication]<br>[Password Reset] --temporal_constraint--&gt; [24 Hour Window]</pre><h3>2. Code Analysis Engine</h3><p>While the intent processor understands what you want, the code analyzer understands what you’ve built:</p><pre>class CodeAnalyzer:<br>    def __init__(self):<br>        self.ast_parser = ASTParser()<br>        self.semantic_analyzer = SemanticAnalyzer()<br>        self.flow_analyzer = ControlFlowAnalyzer()<br>        <br>    async def analyze(self, code: str) -&gt; CodeRepresentation:<br>        # Parse Abstract Syntax Tree<br>        ast = self.ast_parser.parse(code)<br>        <br>        # Extract semantic meaning<br>        semantics = self.semantic_analyzer.analyze(ast)<br>        <br>        # Analyze control flow and data dependencies<br>        flow = self.flow_analyzer.analyze(ast)<br>        <br>        return CodeRepresentation(ast, semantics, flow)</pre><p>This creates a rich representation of your code that includes:</p><ul><li><strong>Control flow graphs</strong> showing execution paths</li><li><strong>Data dependency maps</strong> revealing variable relationships</li><li><strong>Semantic embeddings</strong> capturing the meaning of functions and classes</li></ul><h3>The Magic: Intent-Code Alignment</h3><p>Here’s where the real innovation happens. Our validation engine compares the intent graph with the code representation to find misalignments:</p><pre>class ValidationEngine:<br>    def __init__(self):<br>        self.intent_matcher = IntentMatcher()<br>        self.confidence_scorer = ConfidenceScorer()<br>        self.rule_engine = RuleEngine()<br>        <br>    async def validate(self, intent: IntentGraph, code: CodeRepresentation) -&gt; ValidationResult:<br>        # Neural matching between intent and code<br>        alignment_score = await self.intent_matcher.match(intent, code)<br>        <br>        # Rule-based validation for common patterns<br>        rule_violations = self.rule_engine.validate(code)<br>        <br>        # Calculate confidence in our assessment<br>        confidence = self.confidence_scorer.score(alignment_score, rule_violations)<br>        <br>        return ValidationResult(<br>            alignment_score=alignment_score,<br>            violations=rule_violations,<br>            confidence=confidence<br>        )</pre><h3>Example: Catching Intent Mismatches</h3><p>Let’s say your requirement states: “Users can only reset passwords within 24 hours of email verification.”</p><p>Your code might look like this:</p><pre>def reset_password(user_id: str, new_password: str) -&gt; bool:<br>    user = get_user(user_id)<br>    if user.email_verified:<br>        # Missing temporal constraint check!<br>        update_password(user_id, new_password)<br>        return True<br>    return False</pre><p>Our system would flag this as an <strong>intent mismatch</strong>:</p><ul><li>✅ Intent: “Email verification required”</li><li>✅ Code: Checks user.email_verified</li><li>❌ Intent: “Within 24 hours of verification”</li><li>❌ Code: No temporal constraint check</li></ul><p>The validation engine generates a detailed report:</p><pre>INTENT MISMATCH DETECTED<br>Confidence: 87%</pre><pre>Missing Constraint: Temporal validation<br>Expected: Check if email verification occurred within 24 hours<br>Current: Only checks if email is verified (no time limit)</pre><pre>Suggested Fix:<br>if user.email_verified and (datetime.now() - user.verification_time) &lt; timedelta(hours=24):<br>    # ... rest of logic</pre><h3>Technical Deep-Dive: The AI/ML Architecture</h3><h3>Model Pipeline Design</h3><p>We use a hybrid approach combining state-of-the-art transformer models with custom domain adaptation:</p><pre>class TrainingPipeline:<br>    def __init__(self):<br>        self.data_collector = DataCollector()<br>        self.preprocessor = Preprocessor()<br>        self.model_trainer = ModelTrainer()<br>        self.evaluator = ModelEvaluator()<br>        <br>    async def train(self):<br>        # Collect diverse requirements and code pairs<br>        data = await self.data_collector.collect()<br>        <br>        # Preprocess for domain-specific patterns<br>        processed = self.preprocessor.process(data)<br>        <br>        # Fine-tune models on technical documentation<br>        model = await self.model_trainer.train(processed)<br>        <br>        # Evaluate against quality metrics<br>        metrics = self.evaluator.evaluate(model)<br>        <br>        return model if metrics.meet_criteria() else None</pre><h3>Performance Optimization</h3><p>Our system is designed for production use with strict performance requirements:</p><p>MetricTargetImplementationLatency&lt;500msAsync processing + cachingThroughput1000 LOC/sBatch processing + worker poolsAccuracy&gt;92%Ensemble models + active learningResource Usage&lt;4GB/workerModel quantization + efficient inference</p><p>The key to achieving these targets is our <strong>incremental analysis</strong> approach:</p><pre>class IncrementalAnalyzer:<br>    def __init__(self):<br>        self.cache = AnalysisCache()<br>        self.diff_analyzer = DiffAnalyzer()<br>        <br>    async def analyze_changes(self, old_code: str, new_code: str) -&gt; AnalysisResult:<br>        # Only analyze changed portions<br>        diff = self.diff_analyzer.compute_diff(old_code, new_code)<br>        <br>        # Use cached results for unchanged parts<br>        cached_result = await self.cache.get(old_code)<br>        <br>        # Analyze only the delta<br>        new_analysis = await self.analyze_delta(diff)<br>        <br>        return self.merge_analyses(cached_result, new_analysis)</pre><h3>Building for Scale: Production Architecture</h3><h3>Deployment Strategy</h3><p>We designed the system for horizontal scaling from day one:</p><pre>graph TD<br>    subgraph Cloud Infrastructure<br>        A[API Gateway] --&gt; B[Load Balancer]<br>        B --&gt; C1[Analysis Worker 1]<br>        B --&gt; C2[Analysis Worker 2]<br>        B --&gt; C3[Analysis Worker N]<br>        D[Model Server] --&gt; C1 &amp; C2 &amp; C3<br>    end<br>    <br>    subgraph Storage<br>        E[(Document Store)]<br>        F[(Vector Store)]<br>        G[(Code Cache)]<br>    end<br>    <br>    C1 &amp; C2 &amp; C3 --&gt; E &amp; F &amp; G</pre><h3>Security First</h3><p>Enterprise-grade security is built into every layer:</p><pre>class SecurityManager:<br>    def __init__(self):<br>        self.encryption = AES256Encryption()<br>        self.access_control = RBACManager()<br>        self.audit_logger = AuditLogger()<br>        <br>    async def secure_process(self, data: Data) -&gt; Result:<br>        # Encrypt sensitive data<br>        encrypted = self.encryption.encrypt(data)<br>        <br>        # Validate access permissions<br>        if not self.access_control.validate():<br>            raise SecurityException(&quot;Insufficient permissions&quot;)<br>            <br>        # Process securely<br>        result = await self.process(encrypted)<br>        <br>        # Audit all operations<br>        self.audit_logger.log(result)<br>        <br>        return result</pre><h3>Real-World Impact: What This Means for Developers</h3><h3>Before: Traditional Development Cycle</h3><pre>1. Write code based on requirements<br>2. Run unit tests<br>3. Manual code review<br>4. Deploy to staging<br>5. Discover bugs in production<br>6. Hotfix and redeploy<br>7. Repeat cycle</pre><h3>After: AI-Powered Development</h3><pre>1. Write code based on requirements<br>2. AI validates intent alignment<br>3. Fix intent mismatches immediately<br>4. Run unit tests<br>5. AI-enhanced code review<br>6. Deploy with confidence<br>7. Continuous monitoring and learning</pre><h3>Measurable Results</h3><p>Our pilot implementations show:</p><ul><li><strong>60% reduction</strong> in production bugs</li><li><strong>30% faster</strong> development cycles</li><li><strong>75% reduction</strong> in time-to-detection</li><li><strong>90%+ accuracy</strong> in bug prediction</li></ul><h3>Implementation Roadmap: From MVP to Enterprise</h3><h3>Phase 1: Foundation (3 months)</h3><ul><li>Core validation engine</li><li>Basic intent processing</li><li>Simple code analysis</li><li>REST API interface</li></ul><h3>Phase 2: Enhancement (3 months)</h3><ul><li>Advanced ML models</li><li>Performance optimization</li><li>Security hardening</li><li>CI/CD integration</li></ul><h3>Phase 3: Production (3 months)</h3><ul><li>Enterprise features</li><li>Compliance certification</li><li>Global deployment</li><li>Partner integrations</li></ul><h3>The Future: Continuous Learning and Evolution</h3><p>What makes this system truly powerful is its ability to learn and improve over time:</p><pre>class ActiveLearningLoop:<br>    def __init__(self):<br>        self.feedback_collector = FeedbackCollector()<br>        self.model_updater = ModelUpdater()<br>        <br>    async def continuous_improvement(self):<br>        # Collect developer feedback on predictions<br>        feedback = await self.feedback_collector.collect()<br>        <br>        # Identify areas for improvement<br>        improvement_areas = self.analyze_feedback(feedback)<br>        <br>        # Retrain models with new data<br>        if improvement_areas:<br>            await self.model_updater.update(improvement_areas)</pre><p>Every time a developer corrects a false positive or adds missing validation, the system learns and becomes more accurate.</p><h3>Getting Started: Your First Intent Validation</h3><p>Ready to try this yourself? Here’s a simple example to get started:</p><pre># Install our package<br>pip install intent-validator</pre><pre># Basic usage<br>from intent_validator import IntentValidator</pre><pre>validator = IntentValidator()</pre><pre># Define your requirement<br>requirement = &quot;&quot;&quot;<br>Users must verify their email before accessing premium features.<br>Premium features include: advanced analytics, data export, API access.<br>&quot;&quot;&quot;</pre><pre># Analyze your code<br>code = &quot;&quot;&quot;<br>def access_premium_feature(user_id: str, feature: str) -&gt; bool:<br>    user = get_user(user_id)<br>    return user.email_verified<br>&quot;&quot;&quot;</pre><pre># Validate alignment<br>result = validator.validate(requirement, code)<br>print(f&quot;Intent Alignment: {result.alignment_score:.2f}&quot;)<br>print(f&quot;Confidence: {result.confidence:.2f}&quot;)<br>print(f&quot;Violations: {len(result.violations)}&quot;)</pre><h3>Conclusion: The Future of Software Quality</h3><p>We’re at the beginning of a revolution in how we build and validate software. Traditional tools focus on what code looks like; our system understands what code is supposed to do.</p><p>The combination of advanced NLP, code analysis, and continuous learning creates a feedback loop that makes every developer better at their craft. Instead of catching bugs after they’re written, we’re preventing them before they happen.</p><p><strong>The question isn’t whether AI will transform software development — it’s whether you’ll be leading that transformation or playing catch-up.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e16986c16689" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Bug ID to Bug Age: Mastering Bug Summary for Open/Active Bugs]]></title>
            <link>https://vijayvyawhare.medium.com/from-bug-id-to-bug-age-mastering-bug-summary-for-open-active-bugs-d60d16235365?source=rss-5d631a053960------2</link>
            <guid isPermaLink="false">https://medium.com/p/d60d16235365</guid>
            <dc:creator><![CDATA[Vijay Vyawhare]]></dc:creator>
            <pubDate>Wed, 17 Jul 2024 11:50:16 GMT</pubDate>
            <atom:updated>2024-07-17T11:50:16.941Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cxJvzzQGn4QpTk-nH3Tk-A.jpeg" /><figcaption>Bug Summary</figcaption></figure><p><strong>Introduction To Bug Summary Dashboard</strong></p><p>In the fast-paced world of software development, bugs are an inevitable part of the process. They can disrupt workflows, delay releases, and ultimately impact the user experience. That’s why having a robust bug-tracking system in place is essential for any development team.</p><p>One key component of this system is the Bug Summary Dashboard. This dashboard provides a comprehensive overview of all bugs currently in open or active status within the triage system. It allows team members to quickly assess the status of each bug, who is responsible for addressing it, and how long it has been unresolved.</p><p>The Bug Summary Dashboard not only displays basic information such as bug ID and summary but also provides details on assignees, reporters, dates of creation, and bug age. By consolidating this information into one centralized location, team members can easily prioritize their work and promptly address critical bugs.</p><p>How we built the Bug Summary Dashboard</p><p>In the previous article, as mentioned about test failures, each failure ideally should align with the bug.</p><p>we maintain a label for a release and align all the failures and bugs with that label for an environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*K6FKbmCUs1XlGzrk" /><figcaption><strong>Manage Labels</strong></figcaption></figure><p>Attaching Labels to Test Failures</p><p>For each failure test, the active label for that environment is automatically attached to it for that environment and type( UI or API). Finally, in our bug summary dashboard, we gather all those active bugs and comprehensively show their details.</p><p><strong>Bug Summary Dashboard</strong></p><p>Here, all the live information about a bug is fetched from the Bug Tracking System through the exposed API and displayed. We are maintaining two tables — one for only Today’s bugs and the rest for open bugs. We are also calculating the age of the bugs in the ‘Open Bugs’ table. We have an additional ability to filter them based on environment and type.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HpN-BS11QELxxyYD" /><figcaption><strong>Bug Summary Dashboard</strong></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d60d16235365" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Chaos Engineering: Disrupting to Innovate — A Comprehensive Guide]]></title>
            <link>https://vijayvyawhare.medium.com/chaos-engineering-disrupting-to-innovate-a-comprehensive-guide-12a4f6ed97f9?source=rss-5d631a053960------2</link>
            <guid isPermaLink="false">https://medium.com/p/12a4f6ed97f9</guid>
            <dc:creator><![CDATA[Vijay Vyawhare]]></dc:creator>
            <pubDate>Mon, 15 Jul 2024 09:15:04 GMT</pubDate>
            <atom:updated>2024-07-15T09:15:04.894Z</atom:updated>
            <content:encoded><![CDATA[<h3>Chaos Engineering: Disrupting to Innovate — A Comprehensive Guide</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HSICCPXNgBBKe7UfFq-W6Q.jpeg" /></figure><p><strong>Objectives of Chaos Engineering</strong></p><p>Chaos engineering serves several key objectives essential for robust system development:</p><ol><li><strong>Identifying Vulnerabilities</strong>: By simulating failures and disruptions, chaos engineering illuminates potential weaknesses in both infrastructure and application layers that might remain hidden under normal conditions.</li><li><strong>Enhancing Resilience</strong>: Through systematic chaos experiments, teams can strengthen the resilience of their systems by addressing identified weaknesses and fortifying critical components.</li><li><strong>Validating Assumptions</strong>: Chaos engineering validates assumptions about system behavior under stress, ensuring that performance expectations are met even during adverse conditions.</li></ol><p><strong>Methodologies and Tools</strong></p><p>Chaos engineering leverages diverse methodologies and specialized tools to conduct controlled experiments effectively:</p><ul><li><strong>Infrastructure-Level Testing</strong>: Tools like <strong>Litmus Chaos</strong> are employed to scrutinize infrastructure components such as routing systems and network configurations. These tools enable teams to evaluate system response to failures and anomalies in a controlled environment.</li><li><strong>Application-Level Testing</strong>: Tools like <strong>Chaos Monkey</strong> introduce faults into applications by randomly terminating instances or services. This method assesses application resilience and fault tolerance under diverse failure scenarios.</li></ul><p><strong>Benefits and Impacts</strong></p><p>The adoption of chaos engineering yields significant benefits:</p><ul><li><strong>Proactive Issue Identification</strong>: By uncovering weaknesses early, chaos engineering prevents potential disruptions and downtime in production environments.</li><li><strong>Continuous Improvement</strong>: Insights gleaned from chaos experiments drive continuous improvement efforts, ensuring that systems evolve to meet the demands of reliability and performance.</li><li><strong>Enhanced Customer Experience</strong>: Ultimately, chaos engineering contributes to enhanced customer satisfaction by minimizing the impact of unforeseen failures and enhancing overall system reliability.</li></ul><p><strong>Chaos Engineering at the Infrastructure Level with Litmus Chaos</strong></p><p>In the realm of chaos engineering, ensuring the resilience and reliability of systems is paramount. One effective approach to achieve this is by conducting controlled experiments at the infrastructure level using tools like Litmus Chaos. This methodology involves deliberately injecting chaos into a system to identify vulnerabilities and weaknesses that may not surface under normal operating conditions.</p><p><strong>Litmus Chaos</strong>, specifically designed for Kubernetes environments, provides a powerful platform for orchestrating chaos experiments. It allows teams to simulate various failure scenarios and assess how their infrastructure components — such as routing systems, network configurations, and storage solutions — respond under stress. These experiments are crucial for gaining deep insights into system behavior and performance under adverse conditions.</p><p>Recently, our team embarked on a comprehensive journey to implement chaos engineering practices with Litmus Chaos. Through rigorous experimentation, we successfully uncovered a critical vulnerability in our routing mechanism. This discovery was pivotal as it highlighted a potential weak point that, if exploited, could have resulted in significant downtime or performance degradation.</p><p>In response to this finding, we developed a tailored framework that integrates health checks, load generation, and automated chaos experiments. This framework not only allows us to continuously validate the resilience of our infrastructure but also ensures that we can swiftly mitigate any identified weaknesses before they impact our users.</p><p>By embracing chaos engineering with Litmus Chaos, our team has proactively strengthened our systems and enhanced their ability to withstand unexpected challenges. This proactive approach not only improves system reliability but also fosters a culture of continuous improvement and readiness in anticipating and mitigating potential failures.</p><p>In conclusion, leveraging tools like Litmus Chaos for chaos engineering at the infrastructure level empowers organizations to fortify their systems against unforeseen disruptions, ultimately enhancing overall resilience and reliability.</p><p><strong>Chaos Monkey for Application-Level Testing</strong></p><p>Chaos Monkey is a pivotal tool in the field of chaos engineering, specializing in testing the resilience of applications within production environments. Unlike tools like Litmus Chaos that target infrastructure components, Chaos Monkey operates by randomly terminating instances and services, thereby simulating real-world failures. This deliberate introduction of chaos forces developers and engineers to design and build applications that are inherently resilient.</p><h3>Key Benefits of Chaos Monkey:</h3><ol><li><strong>Identifying Vulnerabilities</strong>: By randomly causing disruptions in a controlled manner, Chaos Monkey uncovers vulnerabilities that may not surface during traditional testing phases. This proactive approach allows teams to address weaknesses before they lead to critical failures in live deployments.</li><li><strong>Strengthening Resilience</strong>: Through chaos experiments, organizations gain insights into how their applications handle unexpected failures. This knowledge empowers teams to enhance error handling, redundancy, and failover mechanisms, thereby bolstering overall system resilience.</li><li><strong>Cultural Shift towards Resilience</strong>: Chaos Monkey promotes a cultural shift towards resilience by encouraging developers to prioritize fault-tolerant design principles. By routinely testing for failure scenarios, teams cultivate a proactive mindset focused on continuous improvement and readiness for unpredictable events.</li></ol><h3>Our Experience with Chaos Monkey:</h3><p>In our journey with Chaos Monkey for application-level testing, we’ve made significant strides in fortifying our software’s robustness. By intentionally inducing disruptions and failures, we’ve pinpointed critical areas for improvement and refined our applications to better withstand operational challenges.</p><p>Moving forward, we are advancing our chaos engineering practices by integrating comprehensive frameworks. These frameworks encompass automated health checks, rigorous load generation, and sophisticated chaos testing scenarios tailored specifically for application resilience. This holistic approach ensures that our applications not only meet but exceed performance expectations in dynamic production environments.</p><p><strong>Developing a Custom Framework for Chaos Engineering</strong></p><p>Chaos engineering has emerged as a critical practice for ensuring the resilience and reliability of modern systems. As organizations prioritize building robust and fault-tolerant infrastructures, chaos engineering enables proactive identification of weaknesses and vulnerabilities before they escalate into widespread outages or failures.</p><h3>Two-Pronged Approach: Infrastructure and Application Levels</h3><p>In our pursuit of chaos engineering excellence, we have adopted a comprehensive approach with two main focuses:</p><ol><li><strong>Infrastructure Level</strong>: Leveraging tools like <strong>Litmus Chaos</strong>, we conduct extensive experiments to uncover vulnerabilities in critical components such as routing mechanisms. These insights are crucial for preemptively addressing potential service disruptions.</li><li><strong>Application Level</strong>: Using <strong>Chaos Monkey</strong>, we simulate real-world failures by randomly terminating instances and services. This approach forces us to design applications with resilience in mind, enhancing overall system robustness.</li></ol><h3>Components of Our Custom Framework</h3><p>To elevate our chaos engineering practices, we are developing a custom framework that integrates essential components:</p><p><strong>Health Check Module</strong>: Continuously monitors the health and performance of our infrastructure in real-time. This proactive monitoring allows us to detect and mitigate potential issues before they escalate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wcKcYkSG4TjYYLIm" /></figure><p><strong>Load Generation Module</strong>: Simulates varying levels of traffic and stress on our applications to evaluate their capacity and performance under different conditions. This module helps us understand system behavior under peak loads.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dDRW2gJpHJ6f1gsMkC5Opg.png" /></figure><p><strong>Chaos Experiments Module</strong>: Facilitates controlled experiments aimed at inducing failures and vulnerabilities within our systems. By intentionally introducing chaos, we uncover weaknesses and implement necessary improvements.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lOzShK38UUe-ccc4U37Y7w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IAbvH-2wf4UiurhqB682_Q.png" /><figcaption><strong>Configure Automation</strong></figcaption></figure><h3>Automation Suite for Chaos Experiments</h3><p>Efficient execution of chaos experiments is facilitated through our custom automation suite:</p><ul><li><strong>Health Checks Integration</strong>: Initiates by validating the operational status of infrastructure components, ensuring they meet predefined health criteria.</li><li><strong>Load Generation Process</strong>: Simulates realistic traffic patterns to stress-test our systems, providing insights into performance scalability and resilience.</li><li><strong>Chaos Scenarios Execution</strong>: Introduces controlled failures and disruptions across our infrastructure. This phase is pivotal for identifying critical vulnerabilities and validating system recovery mechanisms.</li></ul><h3>Continuous Improvement and Proactive Resilience</h3><p>By integrating these components into our custom framework and automation suite, we establish a systematic approach to chaos engineering. This proactive testing and continuous improvement cycle not only fortifies our infrastructure against potential failures but also fosters a culture of resilience and readiness within our organization.</p><h3>Conclusion</h3><p>Our commitment to developing and refining this custom chaos engineering framework underscores our dedication to maintaining high system reliability and resilience. By embracing chaos engineering practices, we ensure that our systems can withstand unforeseen challenges and deliver consistent performance in dynamic operational environments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=12a4f6ed97f9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unveiling the Power of Contract: Elevate Your Testing Efficiency Today]]></title>
            <link>https://vijayvyawhare.medium.com/unveiling-the-power-of-contract-elevate-your-testing-efficiency-today-3d527c4bef44?source=rss-5d631a053960------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d527c4bef44</guid>
            <dc:creator><![CDATA[Vijay Vyawhare]]></dc:creator>
            <pubDate>Fri, 12 Jul 2024 10:44:55 GMT</pubDate>
            <atom:updated>2024-07-12T10:44:55.795Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HWcWyp7jfDl6PlnI" /></figure><p><strong>Introduction To Contract Testing With Pact</strong></p><p>Contract testing using Pact is a powerful tool for ensuring that the interactions between a consumer and provider in a distributed system are reliable and consistent. By creating contracts that define the expected behavior of each party, developers can catch issues early on and prevent integration problems down the line.</p><p>In this approach, the consumer side defines the interactions it expects from the provider by creating a contract. This contract is then pushed to a central repository known as a Pact Broker, where it can be accessed by the provider for verification. The provider uses this contract to ensure that its implementation aligns with what is expected by the consumer.</p><p>By following this process, both parties can work independently and autonomously, knowing that their changes will not break each other’s code. This allows for faster development cycles and greater confidence in releasing new features without causing disruptions in production.</p><p>Overall, contract testing with Pact provides an efficient way to validate API interactions between services in a distributed system, promoting collaboration and reliability throughout the development process.</p><p><strong>What is a Pact?</strong></p><p>Pact is an open-source contract testing tool that enables developers to create consumer-driven contracts for their services. These contracts define the interactions between the services, specifying the expected requests and responses. Pact allows developers to test these contracts independently, ensuring that each service can meet the expectations of its consumers.</p><blockquote><strong>Key Features of Pact:</strong></blockquote><ul><li>Collaborative Contract Definition: Consumers and providers collaborate to articulate and verify contracts, fostering a shared understanding of expected interactions.</li><li>Consumer Expectations: Pact empowers consumers to articulate their expectations regarding interactions with service providers. This helps establish clear guidelines for communication.</li><li>Precise Contract Specifications: Contracts, defined by consumers, outline the expected input and output for each interaction, providing a detailed blueprint for both parties.</li></ul><blockquote><strong>Pact Broker: Centralized Contract Management</strong></blockquote><p>We can publish our pacts from the consumer project by essentially sharing the file system with the provider. But this is not very manageable when you have multiple teams contributing to the code base, and pushing to CI. We can use a <a href="https://pactflow.io/">Pact Broker</a> to do this instead.</p><p>Using a broker simplifies the management of pacts and adds several useful features, including some safety enhancements for continuous delivery which we’ll see shortly.</p><p>The Pact Broker is a centralized repository, transforming contract testing into a well-organized and collaborative process.</p><h3><strong>In our Setup, we are using open-source Pact Broker</strong></h3><blockquote><strong>Pact Broker Setup:</strong></blockquote><p>Utilize the provided Docker file to set up the Pact Broker agent:</p><p>docker-compose -f docker-compose-pactbroker.yml up</p><p>Access the Pact Broker at</p><p><a href="http://localhost:9292/">http://localhost:9292/</a></p><pre>version: &quot;3&quot;<br><br>services:<br>  postgres:<br>    image: postgres<br>    healthcheck:<br>      test: psql postgres --command &quot;select 1&quot; -U postgres<br>    ports:<br>      - &quot;5432:5432&quot;<br>    environment:<br>      POSTGRES_USER: postgres<br>      POSTGRES_PASSWORD: password<br>      POSTGRES_DB: postgres<br><br>  pact-broker:<br>    image: pactfoundation/pact-broker:latest-multi<br>    links:<br>      - postgres<br>    ports:<br>      - 9292:9292<br>    restart: always<br>    environment:<br>      PACT_BROKER_BASIC_AUTH_USERNAME: pact<br>      PACT_BROKER_BASIC_AUTH_PASSWORD: pact<br>      PACT_BROKER_DATABASE_USERNAME: postgres<br>      PACT_BROKER_DATABASE_PASSWORD: password<br>      PACT_BROKER_DATABASE_HOST: postgres<br>      PACT_BROKER_DATABASE_NAME: postgres<br>      PACT_BROKER_DATABASE_CONNECT_MAX_RETRIES: &quot;10&quot;<br>      PACT_BROKER_PUBLIC_HEARTBEAT: &quot;true&quot;<br>      PACT_BROKER_WEBHOOK_SCHEME_WHITELIST: http<br>      PACT_BROKER_WEBHOOK_HOST_WHITELIST: host.docker.internal</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m1GN9HsHyk8cUW35o1fPNA.png" /></figure><ul><li><strong>Central Repository:</strong> Acts as a centralized hub for storing and managing consumer-driven contracts, promoting a systematic approach to contract testing.</li><li><strong>Contract Publication:</strong> Consumers effortlessly publish their contracts to the Pact Broker, establishing a central point for contract visibility.</li><li><strong>Provider Verification:</strong> Service providers retrieve contracts from the Pact Broker for verification, ensuring adherence to agreed-upon contracts.</li><li><strong>Programmatic Verification:</strong> Integration contracts are programmatically verified, instilling confidence and preventing runtime contract violations.</li></ul><blockquote><strong>Creating Contracts For Consumers</strong></blockquote><p>When it comes to contract testing using Pact, creating contracts for consumers is a critical step in ensuring that both the consumer and provider are in sync with each other’s expectations. Contracts define the interactions between the consumer and provider, outlining the expected requests and responses that should be exchanged during testing.</p><p>To create a contract for a consumer, developers need to define the specific interactions that their application will have with the provider. This includes specifying the request parameters, expected responses, and any other relevant information needed for testing. By detailing these interactions in a contract, developers can ensure that both parties are clear on what is expected during testing.</p><p>Once the contract has been defined, it needs to be pushed to a Pact Broker where it can be accessed by the provider for verification. The broker acts as a central repository for all contracts, allowing providers to easily access and verify contracts from multiple consumers. By using this centralized approach, developers can streamline the process of sharing and verifying contracts, making it easier to maintain consistency and accuracy across different services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/1*bBXTZw5Astx71KC_Fi7QLQ.png" /><figcaption><strong>Modify Consumer Build Gradle File</strong></figcaption></figure><pre> @Pact(consumer = &quot;Consumer&quot;, provider = &quot;Provider&quot;)<br>    Response applyRule(PactDslWithProvider builder) {<br><br>        return builder<br>                .given(&quot;apply rule&quot;)<br>                    .uponReceiving(&quot;test rule1 should be applied&quot;)<br>                    .path(&quot;/api/apply-rule/rules&quot;)<br>                    .method(&quot;POST&quot;)<br>                    .body(helper.readJsonFromFile(&quot;client_1_request&quot;))<br>                    .willRespondWith()<br>                    .status(200)<br>                    .headers(helper.baseheaders())<br>                    .body(helper.readJsonFromFile(&quot;client_1_response&quot;))<br>                .toPact();<br>    }</pre><pre>@Test<br>    @PactTestFor(pactMethod = &quot;applyRule&quot;, pactVersion = PactSpecVersion.V3)<br>    void applyRulesWithRule1(MockServer mockServer) {<br>        LOGGER.info(&quot;Server Url: &quot;+mockServer.getUrl());<br>        RestTemplate restTemplate = new RestTemplateBuilder()<br>                .rootUri(mockServer.getUrl())<br>                .build();<br>        String response=new ConsumerService(restTemplate).applyRules(&quot;client_1_request&quot;);<br>        <br>        assertEquals(response,helper.readJsonFromFile(&quot;client_1_response&quot;));<br>    }</pre><blockquote><strong>Generate the Contract (Pact File)</strong></blockquote><p>If all assertions pass and the test completes successfully, Pact will generate a <strong>.json</strong> file representing the contract. This file is then used by the provider to verify that their API meets the expectations defined by the consumer.</p><pre>{<br>    &quot;consumer&quot;: {<br>        &quot;name&quot;: &quot;ConsumerService&quot;<br>    },<br>    &quot;provider&quot;: {<br>        &quot;name&quot;: &quot;ProviderService&quot;<br>    },<br>    &quot;interactions&quot;: [<br>        {<br>            &quot;description&quot;: &quot;a request for testuser id 1&quot;,<br>            &quot;providerState&quot;: &quot;a testuser with id 1 exists&quot;,<br>            &quot;request&quot;: {<br>                &quot;method&quot;: &quot;GET&quot;,<br>                &quot;path&quot;: &quot;/user/1&quot;<br>            },<br>            &quot;response&quot;: {<br>                &quot;status&quot;: 200,<br>                &quot;body&quot;: {<br>                    &quot;id&quot;: 1,<br>                    &quot;name&quot;: &quot;Test&quot;,<br>                    &quot;email&quot;: &quot;test@example.com&quot;<br>                }<br>            }<br>        }<br>    ],<br>    &quot;metadata&quot;: {<br>        &quot;pactSpecification&quot;: {<br>            &quot;version&quot;: &quot;2.0.0&quot;<br>        }<br>    }<br>}</pre><blockquote><strong>Pushing Contracts To Brokers</strong></blockquote><p>Once the contracts have been created for the consumer using Pact, the next step is to push these contracts to a Pact broker. This is a crucial step in the contract testing process as it allows both the consumer and provider to access and verify the contracts.</p><p>Pushing contracts to brokers involves uploading the contract files to a central repository where they can be easily accessed by all parties involved. This ensures that there is a single source of truth for the contracts, reducing the risk of inconsistencies or misunderstandings between consumers and providers.</p><p>By pushing contracts to a broker, both parties can easily retrieve and use these contracts for verification purposes. The broker acts as a mediator between the consumer and provider, facilitating communication and ensuring that both parties are working with the same set of expectations.</p><p>Overall, pushing contracts to brokers streamlines the contract testing process and promotes collaboration between consumer and provider. It helps ensure that any changes made by either party are reflected in the shared contracts, reducing potential errors or discrepancies during testing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*deI0anqMMJ-Hl73H" /><figcaption><strong>Command</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*udTZMOi48hx9jeuo34lDUg.png" /><figcaption><strong>Publish Contract In Pact Broker</strong></figcaption></figure><blockquote><strong>Utilizing Contracts For Providers</strong></blockquote><p>Once the contracts created by consumers have been pushed to the Pact broker, providers can utilize these contracts to verify that their services are compliant with the agreed-upon specifications. By incorporating these contracts into their testing process, providers can ensure that any changes or updates they make to their services do not break compatibility with the consumer’s expectations.</p><p>Utilizing contracts for providers involves setting up a verification process that checks whether the provider’s API responses align with what is defined in the contract. This verification process can be automated using tools like Pact, which can simulate interactions between the consumer and provider based on the contract specifications.</p><p>By utilizing contracts for providers, teams can establish a reliable and efficient way to validate their services’ behavior without having to rely on manual testing methods. This approach helps in detecting issues early in the development cycle and ensures that both parties are working towards a shared understanding of how their services should interact.</p><p>Overall, utilizing contracts for providers streamlines the testing process and fosters collaboration between consumers and providers by establishing a clear set of expectations for service behavior.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*cPKzqYXh49zY0Uck9MiFKQ.png" /><figcaption><strong>Modify Provide Gradle File</strong></figcaption></figure><pre>@PactBroker(<br>        host = &quot;localhost&quot;,<br>        port = &quot;9292&quot;,<br>        authentication = @PactBrokerAuth(username = &quot;pact&quot;, password = &quot;pact&quot;)<br>)<br>@Provider(&quot;RuleEngine&quot;)<br>@ExtendWith(SpringExtension.class)<br><br>@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)<br>public class ApplyRuleEnginePactProviderTest extends BaseTest {<br><br>    private static final Logger logger = LoggerFactory.getLogger(SpringExtension.class);<br><br>    @LocalServerPort<br>    int port;<br><br>    @BeforeAll<br>    static void start() {<br>        ConfigurableWebApplicationContext application = (ConfigurableWebApplicationContext)<br>                SpringApplication.run(RuleEngineApplication.class);<br>    }<br><br>    @BeforeClass<br>    public static void enablePublishingPact() {<br>        System.setProperty(&quot;pact.verifier.publishResults&quot;, &quot;true&quot;);<br>    }<br><br>    @BeforeEach<br>    void setUp(PactVerificationContext context) {<br>        context.setTarget(new HttpTestTarget(&quot;localhost&quot;, port, &quot;/&quot;));<br>    }<br><br>    @TestTemplate<br>    @ExtendWith(PactVerificationInvocationContextProvider.class)<br>    void verifyPact(PactVerificationContext context) {<br>        context.verifyInteraction();<br>    }<br><br>    ObjectMapper objectMapper = new ObjectMapper();<br><br><br>    @State(value = &quot;test1&quot;)<br>    void applyRule1() throws JsonProcessingException {<br>        Map&lt;String, Attribute&gt; expectedAttributes = new HashMap&lt;&gt;();<br><br>        Attribute passportAttribute = new Attribute();<br>        passportAttribute.setDataType(&quot;string&quot;);<br>        passportAttribute.setValues(Arrays.asList(&quot;false&quot;));<br>        passportAttribute.setSlotPlaceholder(true);<br>        passportAttribute.setInPotentiality(true);<br>        passportAttribute.setConditionalPotentiality(Arrays.asList(&quot;string&quot;));<br>        expectedAttributes.put(&quot;PL.SL001.Passport Details.isExpired&quot;, passportAttribute);<br><br>        Attribute approvalAttribute = new Attribute();<br>        approvalAttribute.setDataType(&quot;string&quot;);<br>        approvalAttribute.setValues(Arrays.asList(&quot;Approved&quot;));<br>        approvalAttribute.setSlotPlaceholder(true);<br>        approvalAttribute.setInPotentiality(true);<br>        approvalAttribute.setConditionalPotentiality(Arrays.asList(&quot;string&quot;));<br>        expectedAttributes.put(&quot;PL.SL002.Approval Details.Status&quot;, approvalAttribute);<br><br>        Response simulatedResponse = new Response(&quot;Success&quot;, expectedAttributes);<br><br>        ResponseEntity&lt;APIResponse&gt; responseEntity1 =<br>                ResponseEntity.ok()<br>                        .header(&quot;Content-Type&quot;, &quot;application/json; charset=utf-8&quot;)<br>                        .body(new APIResponse(&quot;Success&quot;, simulatedResponse, 200));<br>        String jsonString = objectMapper.writeValueAsString(responseEntity1.getBody());<br>}<br>}</pre><blockquote><strong>Verifying Contracts In Provider Testing</strong></blockquote><p>Once the consumer has created the contract using Pact and pushed it to the broker, it is now the responsibility of the provider to use this contract for verification purposes. Verifying contracts in provider testing is a critical step in ensuring that both parties are able to communicate effectively and seamlessly.</p><p>The provider must run their own tests against the contract specified by the consumer to verify that their API or service meets all the requirements outlined in the contract. This involves making sure that all endpoints, responses, and data formats align with what was agreed upon in the contract.</p><p>By verifying contracts in provider testing, any discrepancies or errors can be identified and rectified before they impact production environments. This proactive approach not only saves time and resources but also helps build trust between consumers and providers.</p><p>Overall, verifying contracts in provider testing is an essential part of the contract testing process using Pact. It ensures that both parties are on the same page and can confidently rely on each other’s services without any unexpected surprises.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UxOvGoThTp4pnFXV" /></figure><blockquote><strong><em>Can I Deploy</em></strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*NdDr-y4cr7dd-we6IHhyOg.png" /><figcaption>Can</figcaption></figure><blockquote><strong>Benefits Of Contract Testing With Pact</strong></blockquote><p>Contract testing with Pact offers numerous benefits for teams working on microservices architecture. One key advantage is the ability to ensure that consumer and provider services are compatible without the need for integration testing. By creating a contract between the consumer and provider, teams can verify that both sides can communicate effectively and meet each other’s expectations.</p><p>Another benefit of using Pact is the ability to detect breaking changes early in the development process. By defining a contract upfront, any changes made by either the consumer or provider that violate the contract will be flagged immediately, preventing potential issues from propagating through the system.</p><p>Additionally, Pact allows teams to work independently on their services without being blocked by dependencies on other services. Consumer teams can create their contracts and push them to a broker without needing input from provider teams. Providers can then use these contracts to verify their service against what is expected by consumers, enabling faster development cycles and reducing bottlenecks in the integration process.</p><p>Overall, Contract Testing with Pact promotes collaboration between consumer and provider teams, ensures compatibility between services, detects breaking changes early, and enables independent development workflows — all essential components of successful microservices architecture.</p><blockquote><strong>Conclusion: Streamlining The Testing Process</strong></blockquote><p>In conclusion, utilizing contract testing with Pact has proven to be a highly effective strategy for streamlining the testing process between consumers and providers. By creating a contract for the consumer and pushing it to the broker, providers are able to easily verify that their services are meeting the agreed-upon expectations. This approach not only saves time and resources by eliminating the need for manual testing on both sides but also ensures that any changes made by either party are immediately flagged and resolved.</p><p>Furthermore, contract testing with Pact promotes better communication and collaboration between teams by clearly defining the expectations of each service. This transparency helps prevent misunderstandings and reduces the risk of integration issues down the line. Additionally, having a centralized location for all contracts in a broker simplifies management and allows for easy access to historical data.</p><p>Overall, contract testing using Pact offers a streamlined and efficient solution for ensuring that services are working as intended in a distributed system. By implementing this approach, organizations can increase their confidence in their systems while minimizing potential risks associated with integrations.</p><h3>The Power of Pact and TestContainers</h3><p>Now, imagine combining the power of Pact with TestContainers, a tool that provides lightweight, disposable containers for running integration tests. By using TestContainers, you can easily spin up dependent services, such as databases or third-party APIs, in isolated containers during your tests. This ensures that your tests are self-contained and do not rely on external dependencies.</p><p>By integrating Pact with TestContainers, you can create a comprehensive testing strategy that not only validates the contracts between services but also ensures that your application behaves as expected in a real-world environment. This approach can help you catch issues early in the development cycle and prevent regression bugs from creeping into your codebase.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d527c4bef44" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Predicting the Future: How Automation Test Impact Analysis Enhances Testing]]></title>
            <link>https://vijayvyawhare.medium.com/predicting-the-future-how-automation-test-impact-analysis-enhances-testing-ddf290b839e6?source=rss-5d631a053960------2</link>
            <guid isPermaLink="false">https://medium.com/p/ddf290b839e6</guid>
            <dc:creator><![CDATA[Vijay Vyawhare]]></dc:creator>
            <pubDate>Fri, 12 Jul 2024 06:48:29 GMT</pubDate>
            <atom:updated>2024-07-12T06:48:29.967Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*uuuYhC4dk8801FTPL6QQ9g.png" /></figure><p>“As a tool team, we initiated this project as part of our Shift Left Initiatives. We aimed to streamline the process to run tests only for Impacted Code.”</p><p><strong>Mentored By: </strong><a href="https://medium.com/u/4f48cc97301f"><strong>Dhaval Parikh</strong></a></p><p><strong>Introduction</strong></p><p>Maintaining robust software quality is a multi-faceted challenge that requires identifying tests impacted by code changes. This process ensures that newly implemented or modified code is validated by corresponding tests, swiftly detecting and addressing potential issues before they propagate.</p><p>A key benefit of this approach is its ability to streamline the testing process. Instead of running an exhaustive suite of tests for every minor modification, developers can focus on a targeted subset of tests directly impacted by the change. This saves valuable time, optimizes resource allocation, and allows for faster iteration cycles and more efficient use of computational power.</p><p>Moreover, constructing a dependency graph through traceability — mapping out class methods based on controllers — provides a comprehensive overview of how different components interact within the system. This granular visibility enables more precise impact analysis, reducing the risk of overlooking critical dependencies that could lead to failures in production.</p><p>Identifying tests against code changes fortifies software reliability and accelerates development velocity, fostering an environment where quality assurance seamlessly integrates with continuous delivery practices.</p><p><strong>Problem Statement</strong></p><p>Traditional software testing often necessitates running the entire suite of tests for every code change, regardless of its scope or location. This approach is inefficient and time-consuming, especially as codebases grow larger and more complex. Running all tests for every small change leads to longer feedback loops, higher computational costs, and slower development cycles. There is a pressing need for a more targeted approach that can efficiently identify and run only those tests directly impacted by specific code changes. This is where Predictive Test Analysis (PTA) and Test Impact Analysis (TIA) come into play, providing a smarter way to manage and optimize the testing process.</p><h3><strong>Steps to Build PTA/TIA</strong></h3><ul><li><strong>Data Capture</strong></li></ul><p>We should have all the tests irrespective of their status and type to map and run.</p><p>The test can be unit, integration, or end to end.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/935/1*R_z37WDSQb08L6tZxDds-A.png" /><figcaption><strong>Tests Data Capture</strong></figcaption></figure><ul><li><strong>Identify Code Changes and Impact</strong></li></ul><p>The process begins with scanning merge requests (MR) based on commits to extract changes at both class and method levels. If these changes pertain to controllers, their direct mappings with dependent tests are identified using the established dependency graph.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*bn5VYvhYpjC7Sy7ldV6FVA.png" /></figure><ul><li><strong>Building the Dependency Analyzer</strong></li></ul><p>Using traceability ensures that every single test in our testing infrastructure is meticulously tracked. The dependency graph, which establishes a mapping between controllers, classes, methods, and their corresponding tests, serves as an invaluable tool in this process. When a change is detected in a controller class or its methods, this graph helps pinpoint which tests are directly impacted by these changes. By leveraging this direct mapping, we can efficiently determine the subset of tests that need to be executed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*yBjHcTVySR_3qcZ5TD4PGQ.png" /><figcaption><strong>Parent Component with Child Controller class and method</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/863/1*ahwA48LCTfoGWup6WHQDdA.png" /><figcaption><strong>Dependency Analyzer shows all underlying services dependency w.r.t test</strong></figcaption></figure><ul><li><strong>Building Metadata for Non-Controller Class and Method</strong></li></ul><p>Metadata is maintained to keep the relationship between controller classes and methods with each non-controller class and method. This enables a more comprehensive tracking system that can handle changes beyond just the controller classes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/881/1*vTOm7YGw6ToKb8Nq9gVH6w.png" /><figcaption><strong>Class — Method Mapping</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/869/1*zjzjpbYzDrH5P0kS67k4vA.png" /><figcaption><strong>Method — Method Mapping</strong></figcaption></figure><p><strong>Building the Dependency Analyzer: An Overview</strong></p><p><strong><em>Understanding Call Graphs and Dependency Graphs</em></strong></p><p>Capturing call graphs during test execution is a critical step in understanding the intricate relationships within the codebase. This involves monitoring and recording the sequence of method calls made during test execution, creating a detailed map — referred to as a call graph or dependency graph — that illustrates component interactions within the software.</p><p>Our approach uses traceability to ensure that every test in our infrastructure is meticulously tracked. As each test runs, we capture real-time data on method invocations, which are then used to construct comprehensive call graphs. These graphs dynamically reflect the actual execution paths taken by tests, offering an accurate depiction of dependencies.</p><p>The generated dependency graph consists of nodes and edges, where nodes represent classes and methods, and edges signify their interactions. This provides granular insights into how code changes impact specific areas of functionality, which is invaluable for predictive test analysis and test impact analysis, enabling developers to pinpoint affected tests with precision.</p><p><strong>Understanding Dependency Graphs in Controller-Based Class Methods</strong></p><p>Dependency graphs in controller-based class methods are pivotal for accurately assessing the impact of code changes and triggering corresponding tests. A dependency graph maps out the relationships between various classes and methods within a software application. In controller-based methods, these graphs highlight how different components interact, enabling developers to trace dependencies from high-level controllers to individual methods.</p><p>Controllers act as intermediaries that handle incoming requests and delegate tasks to appropriate service classes or modules. Consequently, any modification in a controller class can cascade through multiple application layers. By examining the dependency graph, developers can identify which specific classes and methods will be impacted by changes at the controller level, determining which tests need to be executed to validate the modifications.</p><p><strong>Direct Mapping of Controller Classes and Methods with Dependency Analyzer</strong></p><p>In predictive test analysis and test impact analysis, direct mapping of controller classes and methods using a dependency analyzer is vital. This process ensures that any modifications in the controller layer can be immediately correlated with corresponding tests, streamlining the identification of affected areas within the codebase.</p><p>Controller classes and methods serve as pivotal points in an application’s architecture, often acting as intermediaries between user inputs and backend processing. Changes in these components can have widespread implications. The dependency analyzer constructs a comprehensive map linking each controller class and method to its associated tests. This direct mapping allows for rapid detection of impacted tests whenever a change occurs within these controllers.</p><p>The efficiency brought by this mapping is twofold: it reduces the time developers spend on manual tracking and ensures higher accuracy in identifying which tests need to be executed or modified. By leveraging this automated tool, teams can maintain robust test coverage with minimal overhead, leading to faster iterations during development cycles, and bolstering both productivity and software quality.</p><p><strong>Handling Non-Controller Class and Method Changes</strong></p><p>Handling non-controller class and method changes requires a more nuanced approach than direct mappings available for controller classes and methods. When a code change occurs in a non-controller class or method, the dependency analyzer alone is insufficient to identify the relevant tests directly. This is where metadata becomes invaluable.</p><p>The metadata repository stores comprehensive information about the relationships between all classes and methods within the system, including both controller and non-controller elements. By leveraging this metadata, we can trace indirect dependencies that are not immediately apparent through direct analysis. When a change is detected in a non-controller entity, our system first consults this metadata to determine its associations with any controller classes or methods.</p><p>Through this process, we identify potential impacts on broader application behavior by understanding how non-controller changes might propagate through the system and affect controller operations. Once these connections are established via metadata, the dependency analyzer steps back in to map these findings to specific tests. This dual-step approach ensures that even subtle changes in non-controller components are thoroughly vetted for their impact on overall functionality, safeguarding against unforeseen issues and maintaining robust test coverage across all code modifications.</p><p><strong>Identified Test Run:</strong></p><p>Once identified, these tests are queued for execution, ensuring they run against the latest version of the modified code. This targeted approach saves time and enhances accuracy by focusing on areas most likely affected by recent changes. This results in more efficient testing cycles and quicker feedback loops for developers, maintaining high standards of code quality and performance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/988/1*7mHzCeciCyO_Jn1ujCclig.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*3C9ByNS-DTMo7F2i2urgNg.png" /></figure><p><strong>Workflow:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z56je5gfxN1yp9IwhKryNg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ddf290b839e6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Streamlining Test Execution: The Power of Hub-Spoke Architecture in Test Automation]]></title>
            <link>https://vijayvyawhare.medium.com/streamlining-test-execution-the-power-of-hub-spoke-architecture-in-test-automation-c06d5942fb39?source=rss-5d631a053960------2</link>
            <guid isPermaLink="false">https://medium.com/p/c06d5942fb39</guid>
            <dc:creator><![CDATA[Vijay Vyawhare]]></dc:creator>
            <pubDate>Thu, 11 Jul 2024 15:20:35 GMT</pubDate>
            <atom:updated>2024-07-12T07:02:14.206Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GDMDML0kp_9jLZU_qABNaQ.jpeg" /></figure><p>In today’s fast-paced software development environment, efficient and scalable test automation frameworks are crucial. One such framework that has gained significant traction is the hub-spoke architecture for test automation. This architecture leverages the strengths of distributed systems to manage and execute tests efficiently.</p><p><strong>Mentored By:</strong> <a href="https://medium.com/u/4f48cc97301f">Dhaval Parikh</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t8c9DcPgQ9X_31nr7x21kA.png" /><figcaption><strong>Hub Spoke View</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/881/1*3wz9a6MmvIYZuDkSUPA5vw.png" /><figcaption><strong>Mongo View</strong></figcaption></figure><p><strong>Role Of The Hub: Centralized Test Delegation</strong></p><p>In a distributed testing architecture, the hub plays a pivotal role in ensuring the efficient execution of tests by acting as a centralized point of control. The hub is responsible for managing and delegating test tasks to various spokes within an Amazon EKS (Elastic Kubernetes Service) cluster. By serving as the command center, the hub orchestrates the entire testing process, ensuring that each test is executed seamlessly and efficiently.</p><p>The delegation process begins with chunking, where tests are divided into manageable segments based on their size. This segmentation allows for parallel execution across multiple spokes, optimizing resource utilization and reducing overall testing time. The hub leverages Redis to store the chunking map, which details how tests are divided and assigned to different spokes. Each spoke corresponds to a pod within the EKS cluster and has its mapping stored in Redis.</p><p>Once delegation is complete, the hub monitors progress through a request map also stored in Redis. This ensures that every test request is properly handled and tracked throughout its lifecycle. Upon completion of tests by individual spokes, results are uploaded to Amazon S3 for storage. The spoke then updates its status in the pod map maintained by Redis, allowing the hub to maintain an up-to-date overview of all ongoing activities.</p><p>In essence, the hub’s role extends beyond mere task distribution; it ensures synchronization across various components of this distributed system, facilitating reliable and efficient test execution at scale.</p><p><strong>Chunking Strategy: Efficient Distribution Of Tests</strong></p><p>Efficient distribution of tests is key to the performance of any test automation framework. In our hub-spoke architecture, chunking plays an essential role in this process. Chunking involves breaking down large test suites into manageable chunks based on their size. These chunks are then distributed across different spokes — pods within an EKS (Elastic Kubernetes Service) cluster — for parallel execution.</p><p>The chunking map, which contains detailed information about how tests are divided and assigned, is stored in Redis. This ensures quick access and updates due to Redis’s high-speed in-memory data storage capabilities. Furthermore, each spoke’s mapping is also maintained in Redis to ensure that every pod knows exactly which test chunks it is responsible for. This centralized mapping system helps prevent duplication of work and ensures that all test requests are handled efficiently.</p><p>After executing their assigned tests, spokes send their results to an S3 bucket and update their status back into the pod map stored in Redis. This approach ensures real-time synchronization between all components of our testing infrastructure, making Redis indispensable for robust test management and execution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/987/1*Q3n2sJ-T-uEWkHxR54jvNw.png" /></figure><p><strong>Spoke Pods In EKS Cluster: Execution And Reporting</strong></p><p>Spoke Pods in an EKS cluster play a pivotal role in the effective execution and reporting of tests within a hub-spoke architecture. Each spoke, represented as a pod within the Amazon Elastic Kubernetes Service (EKS) cluster, is dynamically assigned test chunks by the hub. This delegation process hinges on the size of the test, ensuring that workloads are evenly distributed and managed efficiently.</p><p>Once a spoke pod receives its designated test chunk, it undertakes the execution process autonomously. During execution, each spoke maintains communication with Redis to ensure all requests are accounted for and processed correctly as per the request map maintained therein. This ensures no duplication or oversight occurs during test handling.</p><p>Upon completion of its assigned tests, each spoke pod compiles a detailed report encapsulating results and any pertinent data. This report is then securely transmitted to an S3 bucket for centralized storage and future reference. Following successful upload to S3, the pod updates its entry in the pod map within Redis, signifying task completion and readiness for new assignments. This continuous cycle guarantees an efficient testing workflow within the distributed architecture of EKS clusters.</p><p><strong>Ensuring Request Handling With Redis Request Map</strong></p><p>Ensuring that each request is handled efficiently and without duplication is critical to the smooth operation of our testing framework. This is where the Redis request map plays a pivotal role. By leveraging Redis, we can maintain a highly reliable and fast-access system that tracks every incoming test request from initiation to completion.</p><p>When a new test request arrives, it is immediately logged into the Redis request map. This entry serves as a unique identifier for the specific test chunk, ensuring that no requests are lost or mishandled during processing. The central hub references this map to delegate tasks accurately to the appropriate spoke pods within our EKS cluster.</p><p>The use of Redis provides real-time updates and quick lookups, which are essential for maintaining high throughput and low latency in our testing operations. Each spoke pod consults this map before starting its assigned tests, ensuring it only processes tasks designated to it by the hub.</p><p>Once a spoke completes its tests and uploads the results to S3, it updates its status in both the pod mapping and request mapping structures stored in Redis. This final step confirms successful processing and allows us to maintain an accurate log of all test activities, facilitating better tracking, auditing, and reporting across our system.</p><p><strong>S3 Integration For Test Reports And Podmap Updates</strong></p><p>In our distributed testing architecture, seamless integration with Amazon S3 is vital for efficient test report management and accurate pod mapping. Each spoke, functioning as a pod within the EKS cluster, is responsible for executing its assigned chunk of tests and subsequently generating a comprehensive test report. Once the tests are completed, the spoke initiates the process of uploading this report to an S3 bucket designated for storing test outcomes.</p><p>The integration with S3 ensures that test reports are securely stored and easily accessible for further analysis. The upload process is automated and includes metadata tagging to facilitate efficient retrieval and organization of reports. This tagging system also aids in categorizing reports based on various criteria such as timestamp, test type, or execution status.</p><p>Upon successful upload to S3, the spoke updates the pod map stored in Redis. This update mechanism is crucial; it signals that a particular set of tests has been completed and logged, ensuring real-time synchronization across all components involved in the testing pipeline. By maintaining an up-to-date pod map in Redis, we can efficiently track progress and delegate new tasks without any overlaps or redundancies.</p><p>This robust integration between Redis for state management and S3 for storage ensures that our distributed testing framework remains highly efficient, scalable, and reliable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/955/1*i1KuYQFrKh_JaoATgx7yTg.png" /></figure><p><strong>Workflow:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/616/1*oR96mN4veNQCNKV94HBP2A.png" /></figure><p><strong>Key Contributors:</strong></p><p><a href="https://medium.com/u/8a145ac97278">Raj Kishan</a> <a href="https://medium.com/u/b2188f022df8">Sahil Sarwar</a> <a href="https://medium.com/u/d140f938eb07">angshuman das</a> <a href="https://medium.com/u/22589fd24d8">Aman Kumar Singh</a> <a href="https://medium.com/u/866f42c3fb71">hemanth_4435</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c06d5942fb39" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Driving Innovation: Leading a Team to Success in Shift Left Initiatives]]></title>
            <link>https://vijayvyawhare.medium.com/driving-innovation-leading-a-team-to-success-in-shift-left-initiatives-e0c95eddc427?source=rss-5d631a053960------2</link>
            <guid isPermaLink="false">https://medium.com/p/e0c95eddc427</guid>
            <dc:creator><![CDATA[Vijay Vyawhare]]></dc:creator>
            <pubDate>Thu, 11 Jul 2024 11:08:29 GMT</pubDate>
            <atom:updated>2024-07-15T12:53:08.488Z</atom:updated>
            <content:encoded><![CDATA[<p>Embarking on a Shift Left journey with a team and mentor can be both exciting and challenging. Meet <a href="https://medium.com/u/4f48cc97301f">Dhaval Parikh</a>, the guiding force behind our initiatives.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oFsCO3PsjjnL5HhibYMswg.jpeg" /></figure><p>I would like to express my sincere gratitude to <strong>Sudhindra Sridharan </strong><a href="https://medium.com/u/0d552871cb9b"><strong>Sudhindrasridharan</strong></a><strong> </strong>for his invaluable feedback on the Triage System section of this blog post.</p><p><strong>Valuable Teammates:</strong></p><p>Having reliable and dedicated teammates is crucial when building any system. Each member brings a unique set of skills and perspectives to the project, contributing to its success. Working together efficiently, they can overcome challenges and achieve goals effectively.</p><p>Leading a team of freshers and interns under his mentorship opens up a world of possibilities. Let’s delve into this transformative experience together.</p><blockquote><strong>Meet the Freshers and Interns</strong></blockquote><blockquote><strong>Freshers:</strong></blockquote><ul><li><a href="https://medium.com/u/866f42c3fb71">hemanth_4435</a></li><li><a href="https://medium.com/u/b2188f022df8">Sahil Sarwar</a></li><li><a href="https://medium.com/u/cb812bc06d4d">Rohit Jangra</a></li><li><a href="https://medium.com/u/8a145ac97278">Raj Kishan</a></li><li><a href="https://medium.com/u/d140f938eb07">angshuman das</a></li><li><a href="https://medium.com/u/fd3e42816fd4">Aman Kumar Singh</a></li><li><a href="https://medium.com/u/c95261df2771">Prerna Kapoor</a></li><li><a href="https://medium.com/u/9a812a681207">Gopi Krishna</a></li></ul><blockquote><strong>Interns:</strong></blockquote><ul><li><a href="https://medium.com/u/b172256406f9">Mehak</a></li><li><a href="https://medium.com/u/1b81455052f3">Lakshay Jain</a></li><li><a href="https://medium.com/u/5e8b960d22a9">Saranya Seethamraju</a></li></ul><p>In today’s fast-paced digital landscape, software development teams face constant pressure to deliver high-quality products quickly. This demand has led to the emergence of advanced testing tools that streamline processes, detect issues early, and enhance overall software quality.</p><h4><a href="https://medium.com/@vijayvyawhare/automated-test-failure-triage-system-bd0709611e57"><strong>Automated Failure System Triage System</strong></a></h4><p>One such tool is the Automated Failure System Triage System. This tool automates the identification and prioritization of system failures. By swiftly triaging issues, teams can address critical issues promptly, safeguarding overall software performance.</p><p><a href="https://vijayvyawhare.medium.com/predicting-the-future-how-automation-test-impact-analysis-enhances-testing-ddf290b839e6"><strong>Test Impact Analysis</strong></a></p><p>Test Impact Analysis is another powerful tool that helps teams assess the effects of code changes on testing procedures. By analyzing code-test dependencies, teams can focus testing efforts on areas most likely affected by recent updates, optimizing time and resources.</p><p><a href="https://medium.com/@vijayvyawhare/unveiling-the-power-of-contract-elevate-your-testing-efficiency-today-3d527c4bef44"><strong>Contract Testing using Pact</strong></a></p><p>For teams working with microservices architectures, Contract Testing using Pact is invaluable. It defines and tests interactions between services, ensuring each service behaves as specified in the contract.</p><p><a href="https://medium.com/@vijayvyawhare/mutation-test-with-pit-7e9db512b993"><strong>Mutation Testing using Pit</strong></a></p><p>Mutation Testing using Pit is a sophisticated tool for enhancing test suite quality. By making small code changes (mutations) and testing them, teams can pinpoint test weaknesses and bolster code coverage.</p><p><a href="https://medium.com/@vijayvyawhare/chaos-engineering-disrupting-to-innovate-a-comprehensive-guide-12a4f6ed97f9"><strong>Chaos Engineering using Chaos Monkey and Litmuschaos</strong></a></p><p>Chaos Engineering tools like Chaos Monkey and Litmuschaos enable proactive testing of system resilience. Introducing controlled failures and monitoring responses helps teams identify vulnerabilities and fortify software robustness.</p><p><a href="https://vijayvyawhare.medium.com/streamlining-test-execution-the-power-of-hub-spoke-architecture-in-test-automation-c06d5942fb39"><strong>Introducing Hubspoke: Your Ultimate Testing Companion</strong></a></p><p>At the heart of our suite is Hubspoke, a versatile and powerful tool designed to streamline the testing process. With Hubspoke, you can efficiently run tests, track results, and collaborate with your team in real time. Say goodbye to manual testing processes and hello to automation and efficiency with Hubspoke by your side.</p><p><strong>Test Failure Prediction: Anticipate Issues Before They Arise</strong></p><p>One of the most frustrating aspects of testing is dealing with unexpected failures. But with our Test Failure Prediction tool, you can proactively identify potential issues before they impact your project. By analyzing historical data and trends, this tool gives you the insight you need to address potential failures before they derail your progress.</p><p><strong>Test Flaky Prediction: Enhancing Test Reliability</strong></p><p>Flaky tests can be a major headache for developers, causing delays and uncertainty in the testing process. Our Test Flaky Prediction tool leverages advanced algorithms to pinpoint flaky tests before they become a problem, ensuring the reliability and accuracy of your testing results.</p><p><strong>Developer Metrics — Dora: Empowering Data-Driven Decision-Making</strong></p><p>Data is king in the world of software development, and our Developer Metrics tool provides you with the insights you need to make informed decisions. From code quality metrics to team performance indicators, this gives you a comprehensive view of your development process, empowering you to optimize performance and drive success.</p><p><strong>Performance Testing with Gatling</strong></p><p>Gatling is a widely adopted tool for performance testing, enabling teams to simulate heavy loads on servers, networks, and objects. It identifies performance bottlenecks and enhances scalability and reliability.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e0c95eddc427" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering Mutation Testing with Pit Building a Reliable Pipeline And Scheduler]]></title>
            <link>https://vijayvyawhare.medium.com/mutation-test-with-pit-7e9db512b993?source=rss-5d631a053960------2</link>
            <guid isPermaLink="false">https://medium.com/p/7e9db512b993</guid>
            <dc:creator><![CDATA[Vijay Vyawhare]]></dc:creator>
            <pubDate>Thu, 11 Jul 2024 06:45:10 GMT</pubDate>
            <atom:updated>2024-07-12T08:06:36.255Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*FfqLcO6gstbixGrUse-y9Q.png" /></figure><p>“Embarking on a mission to bolster the effectiveness of our unit tests, our tool team set out to elevate the quality of our testing practices. Join us on this project journey as we delve into the importance of robust unit tests and the strategies we employed to ensure their excellence.”</p><p><strong>Mentored By:</strong> <a href="https://medium.com/u/4f48cc97301f">Dhaval Parikh</a></p><p><strong>Introduction</strong>:</p><p>In the realm of software development, ensuring the robustness of our code is crucial to delivering a high-quality product. One technique that has gained popularity in recent years for assessing the effectiveness of our test suites is mutation testing. It involves introducing small changes, or “mutations,” into your code to see if your existing tests can detect them. This process helps identify weaknesses in your test suite, ensuring that your tests are robust and reliable. When it comes to mutation testing in Java projects, the PIT mutation testing tool is a standout choice. In this blog post, we will delve into how we can supercharge our mutation testing process using PIT, AWS EC2, Jenkins, and S3 to create a seamless and efficient workflow.</p><h4>Setting the Stage: AWS EC2 Instance</h4><p>To kickstart our mutation testing journey, we set up a dedicated EC2 instance on AWS. This instance acts as the powerhouse where all the mutation-testing magic happens. By isolating this process on a separate EC2 instance, we ensure that our local environment remains unburdened and the testing runs smoothly without any hiccups.</p><h4>Automating with Jenkins Pipeline and Scheduler</h4><p>Automation is the key to streamlining our mutation testing process. By leveraging Jenkins, we created a robust pipeline that triggers the mutation testing on our EC2 instance at a sequential schedular. This automation not only saves us time and effort but also ensures that our code is continuously being put through the mutation testing wringer to catch any potential weaknesses in our test suite.</p><p>Setting up a Jenkins pipeline for mutation testing involves several coordinated steps to ensure that every Java service undergoes rigorous quality checks. The process begins with defining the pipeline in Jenkins, which triggers mutation tests using PIT (Pitest). This setup is crucial for maintaining high standards of code quality by ensuring unit tests are genuinely robust and not just meeting superficial thresholds like those set by quality gates or SonarQube.</p><p>First, the pipeline configuration in Jenkins needs to be meticulously detailed. The configuration file, often a Jenkins file, specifies stages such as code checkout, build, and execution of mutation tests. When the pipeline is triggered — either through code commits or scheduled intervals — a sequence of operations kicks off on an EC2 instance.</p><pre>mvn test-compile org.pitest:pitest-maven:mutationCoverage<br><br># To Generate Muatation report is the bash command in jenkins jobs</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*16TCh_7s09ta6kV60oZUWw.png" /><figcaption><strong>Jenkins pipeline stage to generate a report</strong></figcaption></figure><h4><strong>Harnessing the Power of S3 for Reporting</strong></h4><p>Once the mutation testing is completed, we need a centralized location to store and access the generated reports. This is where Amazon S3 comes into play. By pushing the mutation testing reports to S3, we create a repository of invaluable insights into the effectiveness of our test suites. This centralization makes it easy to track trends over time and identify areas for improvement in our testing strategies.</p><h4><strong>Visualizing Mutation Reports on the Dashboard</strong></h4><p>At a glance, developers can view critical statistics such as the overall mutation score, which indicates the percentage of mutants killed by existing unit tests. Detailed breakdowns are also available, showcasing which specific mutants survived and which were effectively caught by tests. Interactive charts and graphs present this data dynamically, allowing users to drill down into particular services or modules for a more granular analysis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MxQB6RGyvtHIVwsszyA8lw.png" /><figcaption><strong>Mutation Test view in Centralized System</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/1*HCvfhIUozBK9JrzxHowV2w.png" /></figure><h3><strong>Historial Report For Services</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_oc0x6L-xt4-5hWd0Z1QyA.png" /><figcaption><strong>Historical Report</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/984/1*28rRhJ9p7oe36q9TLxgQ7g.png" /></figure><h4><strong>Enhancing Test Quality and Effectiveness with Mutation Reports</strong></h4><p>The ultimate goal of mutation testing is to enhance the quality and effectiveness of your unit tests. By continuously generating and analyzing mutation reports, developers gain valuable insights into the robustness of their tests. These insights highlight specific areas where tests may be lacking, providing clear guidance on where improvements are needed.</p><p>Using the detailed feedback from mutation reports, developers can write more effective unit tests that catch a wider range of issues. This process not only improves test coverage but also ensures that the tests themselves are meaningful and reliable. As a result, the overall quality of the codebase is significantly enhanced, leading to more robust and maintainable software.</p><p>Incorporating mutation testing into your continuous integration pipeline, and leveraging tools like Jenkins and PIT, ensures that your unit tests are not just a formality but a powerful tool for maintaining high code quality. This approach fosters a culture of continuous improvement and rigorous testing, ultimately contributing to the development of better, more reliable software products.</p><p><strong>Mutation Workflow:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*VO8WLoCn5W3KCUk4BjOz1w.png" /><figcaption><strong>E2E Mutation Workflow</strong></figcaption></figure><p>In the development of our Mutation initiative, the key contributors were <a href="https://medium.com/u/cb812bc06d4d">Rohit Jangra</a> <a href="https://medium.com/u/fd3e42816fd4">Aman Kumar Singh</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e9db512b993" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automated Test Failure-Triage System]]></title>
            <link>https://vijayvyawhare.medium.com/automated-test-failure-triage-system-bd0709611e57?source=rss-5d631a053960------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd0709611e57</guid>
            <dc:creator><![CDATA[Vijay Vyawhare]]></dc:creator>
            <pubDate>Tue, 09 Jul 2024 10:40:33 GMT</pubDate>
            <atom:updated>2024-07-12T07:54:29.778Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3zxrsmO-I2R_kVAL" /></figure><p>“As a tool team, we initiated this project as part of our Shift Left Initiatives. Our goal was to streamline the process of handling test failures to reduce turnaround time.”</p><p>Mentored By: <a href="https://medium.com/u/4f48cc97301f">Dhaval Parikh</a></p><p>Proactive Feedback Provided By: <a href="https://medium.com/u/0d552871cb9b">Sudhindrasridharan</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P5td4xbTYvFwIZ8sHimIHA.png" /><figcaption><strong>Landing Page Of Centerized System</strong></figcaption></figure><p><strong>Introduction</strong></p><p>In the dynamic world of software development, efficiency and reliability are paramount. Continuous integration and delivery (CI/CD) rely heavily on automated testing to ensure the integrity of applications. Jenkins, a cornerstone in orchestrating test runs, simplifies these processes, yet navigating through jobs and tabs can be time-consuming. This challenge is where our innovative Triage System shines.</p><p>The Triage System serves as a critical bridge between identifying and resolving test failures swiftly. It employs a structured approach, analyzing logs, screenshots, and diagnostic data to categorize issues stemming from code defects, test script glitches, or environmental factors. By automating this triage process, teams accelerate problem resolution, minimize errors, and reduce downtime in development cycles.</p><p>The primary focus of the Triage System is to streamline the triage process for test failures. As automated testing detects issues, the Triage System plays a pivotal role in categorizing, analyzing, and offering valuable insights into failures. These insights include identifying the root cause, analyzing previous occurrences, identifying potential bugs, pinpointing offending microservices/components, and ensuring test consistency.</p><blockquote><strong><em>Problem Statement:</em></strong></blockquote><p>Aligning test failures with corresponding bugs is crucial yet challenging, primarily due to factors such as distinguishing genuine failures from flaky test issues. The triage process is essential for differentiating between failures caused directly by tests and those indicating actual software issues. Moreover, it accelerates the conversion of test failures into actionable bugs.</p><p><strong>Automating Test Failure Triage Process</strong></p><blockquote><strong><em>The Refinement Process</em>:</strong></blockquote><p>Refers to the systematic steps taken to enhance the accuracy, reliability, and relevance of identified issues or failures.</p><blockquote><strong>Challenges in the Current Process</strong></blockquote><p>The current triage process involves several manual steps to identify and categorize test failures, including ignoring flaky tests and determining genuine failures. However, this manual approach can be time-consuming, error-prone, and inefficient, especially as the scale of testing increases.</p><p><strong>What to Automate?</strong></p><p>Focus on automating the following aspects of the triage process:</p><ul><li><strong>Flaky Test Detection:</strong> Identify and exclude flaky tests from further consideration automatically.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*Z5PwkONcw9Ttv8n87JXxfg.png" /><figcaption>Flaky GRU Data Model</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PPxMNVwPeJqqsojveUczjA.png" /></figure><ul><li><strong>Failure Type Identification:</strong> Categorize failures based on predefined criteria (infra issues, API latency, UI issues, etc.).</li><li><strong>Root Cause Analysis:</strong> Automate the process of determining the underlying cause of each failure.</li><li><strong>Predictive Bug Analysis: </strong>Automate the process of assigning a bug to test failures based on Machine Learning and Anomaly detection algorithm.</li><li><strong>Issue Reporting:</strong> Automatically generate reports or notifications for identified issues, integrating with existing tools and workflows.</li><li><strong>Failure Trend: </strong>Historical Trends of failures in a job.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/1*RIPlVMGRVLIXH11QzZfg1Q.png" /></figure><ul><li><strong>Execution Time Trend: </strong>Each job time taken trend.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*x8VMx5Yur96QlNY6lt_-aQ.png" /></figure><ul><li><strong>Execution Count Trend:</strong> Each Job test execution count trend.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/955/1*T09Ohs0rm2KScnnQ7Vxqmg.png" /></figure><ul><li><strong>Test Consistency View: </strong>What all tests are consistent (Pass, Fail, Flaky) actress releasees.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*fWGW-irieTTG-_zA4T8ohw.png" /></figure><ul><li><strong>Health Check and Circuit Breaker:</strong> Each Services health check and breaker.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/915/1*YAs-smsRh6v7omktBrywCw.png" /></figure><ul><li><strong>Test Comparision View: </strong>Compare tests with any historical date or run.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BkDXA3xvL43Sd8I5Dot4og.png" /><figcaption><strong>Any time we can have two date tests comparison with diff</strong></figcaption></figure><p><strong>Top Failures:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4GyF6UwebngmMEqxfo6XDw.png" /></figure><ul><li><strong>Rerun of Failure Test: </strong>Effective and Faster run of failure tests at any moment.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/911/1*SBCsyOoej53GJvY1c0WUBQ.png" /></figure><p><strong>Rerun dashboard and Tracker:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*Yd3rEaplbWLL0FsjUUwszw.png" /><figcaption><strong>Rerun Result to Cross Check rerun triggered by Hub-Spoke</strong></figcaption></figure><p><strong>Stack Trace Classification:</strong> Test Impacted due to unique stack trace.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7yAkteccoGVtnVRdeHDh_Q.png" /><figcaption><strong>Test failed due to unique stack traces</strong></figcaption></figure><p><strong><em>Why Automate the Refinement Part?</em></strong></p><p>Automating the refinement part of the triage process offers several advantages:</p><p>1. <strong>Efficiency</strong>: Automation reduces the time spent on manual review and decision-making, allowing teams to focus more on productive tasks.</p><p>2. <strong>Consistency</strong>: Automated processes ensure that each test failure is assessed using the same criteria and algorithms, reducing variability in triage decisions.</p><p>3. <strong>Scalability</strong>: As the number of tests and frequency of test executions increase, automation can handle larger volumes of data more effectively than manual methods.</p><p>4. <strong>Accuracy</strong>: Automated tools can leverage machine learning algorithms or predefined rules to make more accurate assessments of test failures, distinguishing between flaky tests and genuine issues.</p><p>5.<strong>Last but not least: </strong>Data in today’s world data is the source of all solutions, based on data collected during the process makes base for future enhancements of Predicative and AI/ML based models to further improve triage process.</p><p><strong><em>How to Implement Automated Test Failure Triage System?</em></strong></p><p>To effectively automate the triage process, consider the following steps:</p><ol><li><strong>Data Collection: </strong>Implement robust logging and data collection mechanisms during test executions. Capture relevant information such as logs, screenshots, performance metrics, and test environment details.</li><li><strong>Flaky Test Identification: </strong>Develop algorithms to detect and flag flaky tests. This may involve statistical analysis of test results over multiple runs to identify inconsistencies.</li><li><strong>Failure Categorization: </strong>Use machine learning models and rule-based systems to categorize test failures into different types (e.g., infrastructure issues, API latency, UI rendering, business logic errors).</li><li><strong>Root Cause Analysis: </strong>Automate the analysis of failure patterns to determine the root cause. This could involve examining historical data, comparing current failures with known issues, or correlating failures with recent code changes.</li><li><strong>Integration with Issue Tracking Systems: </strong>Automatically create or update issues in bug tracking systems (e.g., Jira) based on automated triage results. Link test failures to corresponding bugs or issues for further investigation and resolution.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tlc8bVZ5wQOF_bPzjHFWXA.png" /></figure><p><strong><em>Best Practices for Implementing a Triage System</em></strong></p><p>Implementing an effective triage system for automation test failures requires a strategic approach that balances technical proficiency with operational efficiency. To start, fostering a culture of collaboration and communication among development, QA, and operations teams is crucial. This ensures that when a failure occurs, the necessary knowledge and expertise are immediately accessible for swift resolution.</p><p>Central to the triage process is the establishment of clear criteria for prioritizing issues. This involves categorizing failures based on their impact on the product and business objectives. High-impact issues that affect critical functionalities should be addressed first, while less critical ones can be scheduled for later analysis.</p><p>Automation in data collection is another best practice. Leveraging tools to automatically gather logs, screenshots, and system states at the point of failure can significantly reduce manual effort and speed up diagnosis. Additionally, integrating these tools with your Continuous Integration/Continuous Deployment (CI/CD) pipeline ensures that failures are detected as early as possible.</p><p>Regularly updating and refining your test cases based on historical data from triaged incidents can prevent recurring issues. Finally, documentation plays a vital role, maintaining comprehensive records of past failures and resolutions aids in quicker troubleshooting in future incidents. By embedding these practices into your triage system, you ensure not only rapid response but also continuous improvement in your testing processes.</p><p><strong>Valuable Teammates:</strong></p><p>Having reliable and dedicated teammates purely freshers and interns is crucial when building any system. Each member brings a unique set of skills and perspectives to the project, contributing to its success. Working together efficiently, they can overcome challenges and achieve goals effectively.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd0709611e57" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>