
AI is transforming software testing offering new tools and methodologies to enhance the efficiency, accuracy, and scope of testing activities. Urgent production incidents that are critical occur often, requiring swift intervention. QA needs to first analyze these issue, putting in a significant amount of manual effort into pinpointing the root cause, assigning the priority, and determining if it is a defect, an enhancement, or a task. Case in point, the recent CrowdStrike issue that caused support teams to be bombarded with production incident tickets after the outage.
In a normal-size organization, the support team that handles the tickets is generally quite small, and production incidents have short SLA spans making it tricky to perform individual ticket analysis. I am introducing an machine learning (ML)/artificial intelligence (AI) solution that utilizes deep learning models – image classification with TensorFlow and Keras – along with natural language processing (NLP) – to automatically analyze production incidents, cutting down manual efforts, and allowing for a quicker resolution for business users.
Real Time Incident Flow Scenario
Many service-based organizations cater to end clients that are product companies. In case of any new deployment, these end users are directly affected and when that happens, they raise new support tickets. Also known as real-time defects, these are high-priority incidents that require immediate triage. Some examples include a newly deployed API throwing a 5xx error, or a malfunctioning login service that has brought the entire business to a halt. For such P1 incidents where SLA windows are typically very narrow, automating certainly helps.
In this case, I will utilize text extraction for reading the content of the email body for the client name, the defect category (incident, new business requirement or followup), and criticality (high medium, or low) of the issue. This information helps developers to understand what kind of issue it is and whether they need to triage it in the current sprint or delegate it to the next one based on priority upfront.
To ensure that I have full confidence in the output of the text classification model, I will use image classification on the client logo in the email which will predict the client and then match the outputs of both the text extraction model and image classification model, verifying the client. Below is everything we are going to predict from the incidents emails –
- The sender
- The criticality of the incident
- The category/priority of this incident
- And how to predict the client logo from email
Text Extraction – NLP Sentiment Analysis
Sentiment analysis as part of natural language processing is the method of collecting sentiments or opinions expressed in text data. This is key to real-time problem detection. One can use user feedback (both direct and those via social media), support tickets and other textual sources to surface emerging issues.
Implementation
Start by collecting text data from different sources – customer reviews, social media platforms (e.g. X), support tickets or emails – and feed it into the NLP sentiment analyzer.
- Data Collection – Gather the text data from sources like Web HTML, support tickets or internal databases. Python provides several libraries, such as requests and Beautiful Soup to help scrap and collect data from the HTML Web. This process helps to identify which client sent the concerned emails.
- Data Preprocessing– Preparing the text for further analysis through tokenization, lemmatization or stop-word removal help segmenting the text to discernible parts and removing noise.
- Text Mining – Sentiment Analysis: Next step is analyzing the processed text using trained machine learning models designed to recognize sentiment. The text is classified as positive, negative, or neutral for such models based on sentiment. This process helps identify the priority, severity and categorization of the defect.
- Identifying ML Model: Depending on text mining goals, build machine learning models to perform tasks like classification, clustering, or recommendation. Common libraries for text classification include scikit-learn and TensorFlow.
Benefits
- Proactive Problem Solving: With sentiment analysis, developers can catch issues early – often before they turn into Priority1 incidents – and work on fixing them ahead of time.
- Development Prioritization Based on User Sentiment: When defects affecting the user experience are systematically prioritized, developers know what bugs they must fix to have robust production.
- Scalability — NLP sentiment analysis has quick data processing capabilities for large numbers of data, well-suited for companies dealing with a large variety or volume of product offerings and a huge user base.
What is Image Classification, and Why Do We Need It?
Image classification, a branch of computer vision, is a technique by which an image is classified into one or multiple predefined classes based on content.
For production incident triage, the NLP model will provide the category and criticality of the defect, and while from the email content, we will get the client specifics. Bt we can put additional confidence on our NLP model by validating the logo present in the customer’s email. If this logo matches the client logo which we are getting from the NLP model, we can confidently say that the incident is tied to the particular client. We can then route it to respective team with minimal chances of error.
To detect client’s logo in the email, we need to train the image classification model.
- Model training: In the above image, we can see the model and the dataset where data (images) is loaded from, into a neural network such that it derives learning patterns in the form of weights. The training and testing datasets for logo defect detection would contain a set of examples of the correct logos. The model will learn the different classes by identifying patterns in the images.
- Image Capture in Real-Time: When we finish training our model, we will set it up to capture images of the logo from customer emails.
- Image Processing: We will process captured images to make them the same size, orientation, and color, and then standardize them before performing classification.
- Opinions: Finally, the model classifies these images as matching clients, or null output if logos are not matching any clients.
- Defect Reporting: It generates a defect report and raises an alert when it identifies null which means we need to retrain our data on more client logos.
Final End to End Flow Diagram for Defect AnalysisÂ
Here both NLP sentiment analysis and image classification are incorporated into one unified defect analysis system to be more advantageous. The integrated approach ensures comprehensive insights into potential client detection through use of both text and image data.
- Data Integration: The comprehensive view of incidents analysis is a key advantage to the integration between data from NLP sentiment analysis and image classification. For instance, if users send negative reviews, then through email content and client logo, it is passed to the above flow diagram utilizing text and image classification process for automatic analysis.
- Automated Workflow: Using cloud frameworks, we can integrate this flow providing automated defect detection and reporting. For example, if we received an user feedback email, it can call an API further invoking ML-deployed code which will provide client-related information utilizing the same flow diagram.
ML Model Deployment
Above the flow diagram is runtime ML model deployment for defect prediction analysis on a real-time basis calls. The models need to be kept up-to-date and maintained so that they are still useful as new types of defects occur or software is modified.
Steps For Model Deployment
- Model Preparation and Upload (Train and Save Model): Train our machine learning model in a framework, save it as. pkl (pickle) file. Upload the. pkl file to s3 bucket.
- Configure AWS Lambda:Â Load the model accessing s3 bucket and receive prediction by feeding new runtime.
- API Gateway Integration: Configure our API Gateway to link the Lambda function so that it can be triggered when requested.
Conclusion
Software testing use case is now a step closer to real-time defect analysis with NLP sentiment analysis and image classification with model deployment using ML. Using these technologies, organizations can detect and troubleshoot defects faster and more accurately, thus enhancing quality and ensuring user satisfaction. With the ever-evolving AI cousin, we can expect to see more tools like this being integrated into and used in defect analysis going forward, opening even more avenues of innovation and efficiency for software development.