//

Researchers develop automated approach to debugging software

By identifying defective code automatically, developers can reduce time spent on debugging and refocus their efforts on designing new or improving existing software.

The increased use of technology in every facet of human life requires the development of computer hardware and software that make the technologies function. The software are developed through a painstaking process that involves writing thousands of lines of code by developers. In many instances, the code may have defects called bugs that hamper the way they are intended to function. 

To remove these bugs, developers usually need to sift through lines of code using a variety of methods. This laborious “debugging” often consumes a considerable amount of time and resources, meaning programmers need fast and efficient testing processes. So far, these much-needed processes have been lacking. 

Many test automation frameworks used to detect bugs have proven inefficient because the initial setup is challenging, tests are hard to implement, and maintaining them is difficult. 

The problem with debugging software

Traditional test automation presents difficulties for several reasons. For example, it needs highly qualified engineers who can both set up test frameworks and write automated tests. When it comes to structure and architecture, typical automation frameworks are harsh. While there are several ways to create tests that would yield pass or fail results, only a few will check for the right thing and produce reliable tests.

Another issue is the framework’s architecture. Traditional automated tests are created from an engineering perspective rather than from the standpoint of the end user, since they require some understanding of the implementation details. Instead of referencing an element the way a user would see it, you use its id, XPath, or any other type of locator. 

In addition, previously automated tests are rarely reviewed to determine if they are valid or testing for the right things because of how complex and difficult they are to read.

Interestingly, artificial intelligence offers a new way of resolving these problems in software testing.

Recently, researchers from Singapore Management University (SMU) have devised an adjustable, automated technique for debugging software. The technique combines the features of prior solutions while innovating with new ones. The new solution could save programmers the headache of having to comb through hundreds of lines of code to find an errant bug. 

An automated solution

The new automated debugging solution is based on AI, and is aimed at assisting developers to conduct debugging exercises more effectively. One of the approaches proffered by the new solution examines the information accessible in bug reports. The other looks at the data gathered by conducting a set of test cases. 

David Lo from the SMU’s School of Information Systems led the team that developed the solution, named Adaptive Multimodal Bug Localisation (AML). AML extracts debugging hints from test cases and bug reports. These are used to conduct a statistical analysis to identify program elements that may possibly be buggy.

Lo explains that AML is the “missing link” that will aid the integration of various information gathering threads.

“While most past studies only demonstrate the applicability of similar solutions for small programs and ‘artificial bugs’ [bugs that are intentionally inserted into a program for testing purposes], our approach can automate the debugging process for many real bugs that impact large programs,” Dr Lo explains.

Our approach can automate the debugging process for many real bugs that impact large programs.

David Lo, Professor of Computer Science at Singapore Management University

AML has been evaluated with success on programs with over 300,000 lines of code. By automatically identifying defective codes, developers can spend less time debugging and more time building new software features for clients. 

chart flow detailing how AML works
Network-clustered multi-modal bug localisation.
Credit: Semantic Scholar

Dr Lo and his colleagues intend to reach out to numerous industry partners to advance AML’s integration as a software development tool. 

Dr Lo’s future goals include establishing a software analytics solution on an Internet scale. This would involve analysing vast quantities of information passively existing in innumerable internet sources in order to transform manual, arduous, and error-prone software engineering processes into automated actions that can be executed quickly and consistently.

Dr Lo explains that this is accomplished by extracting public knowledge, which has been accumulated over the years by thousands of software developers from passive, dispersed, and diverse data sources.

Apart from Dr Lo’s innovative solution to debugging, a number of artificial intelligence-powered solutions are available today to enable developers to get solutions to headaches caused by bugs. 

Although still relatively new, AI-enhanced test automation tools are superior to conventional automated tools in almost every way. For example, they save time to set up and create tests. Initial setup with traditional test automation frameworks often takes anywhere from a few days to a few weeks. 

However, setup is just the beginning. Writing tests from scratch is difficult and can take a lot of time. Using AI testing tools like testRigor can make the job much easier. With these tools, a basic setup takes a few minutes, and developing an automated test takes about as long as writing the steps for a manual one. Users can simply refer to the elements seen on the screen, and the machine learning algorithms will take care of the rest.

These automated tools also solve other issues programmers face on multiple levels, from test instability to lack of proper maintenance, bringing the automation experience to a whole new level. It reduces the time spent creating and maintaining tests, and anyone with any level of coding skills can easily build automated tests with fuller coverage, helping to identify bugs more efficiently and saving costs.

🔬🧫🧪🔍🤓👩‍🔬🦠🔭📚

Journal Reference

Hoang, T., Oentaryo, R. J., Le, T.-D. B., & Lo, D. (2019). Network-clustered Multi-Modal Bug Localization. IEEE Transactions on Software Engineering, 45(10), 1002–1023. https://doi.org/10.1109/tse.2018.2810892

Chidirim Ndeche

Chidirim Ndeche is a reporter at Breakthrough.

Latest from Blog