Browse Prior Art Database

Source code analyzer extracting relevant data used to build test cases

IP.com Disclosure Number: IPCOM000246492D
Publication Date: 2016-Jun-13
Document File: 5 page(s) / 524K

Publishing Venue

The IP.com Prior Art Database

Related People

Erwan Gereec: INVENTOR

Abstract

In developing tools to configure customer networks on the paper, and simulate financial charges for network use, there is a need to develop automatic test cases able to simulate different network configurations, and check that the corresponding simulated financial charge is appropriately calculated by the tool. The invention is a method to automatically extract relevant data from a web application which can be used to build test case scenarios.

This text was extracted from a Microsoft Word document.
At least one non-text object (such as an image or picture) has been suppressed.
This is the abbreviated version, containing approximately 56% of the total text.

Inventor: Erwan Gereec

Source code analyzer extracting relevant data used to build test cases

In developing tools to configure customer networks on the paper, and simulate financial charges for network use, there is a need to develop automatic test cases able to simulate different network configurations, and check that the corresponding simulated financial charge is appropriately calculated by the tool.

The invention is a method to automatically extract relevant data from a web application which can be used to build test case scenarios. It provides for 3 sequential sub-processes to extract relevant data from a web page to be used to build test cases: SPLIT PROCESS, IDENTIFICATION PROCESS  and CATEGORIZE PROCESS.

Fig 1: Global view of source code analyzer processes

Here is a technical description of each steps:

  1. SPLIT PROCESS: This step is implemented using a JavaScript code able to extract and produce an array containing all elements contained in the web page.

Fig 2: SPLIT process of source code analyzer

  1. IDENTIFICATION PROCESS: Get all elements and select only relevant elements which can be used to build test cases ;

Fig 3: IDENTIFICATION process of source code analyzer

 

  1. CATEGORIZE PROCESS: In relevant elements set, sort them to know what elements could be considered as ACTIONS elements and which elements could be considered as ASSERTS elements.

Fig 4: CATEGORIZE process of source code analyzer

Technically, the source code analyzer is a JavaScript library which can be added in any web page application to extract relevant data on it. Here is the entire source code developed to create this library:

1.  (function(window){  

2.    

3.      function CAnalyzer(){  

4.            

5.          // RELEVANT NODE  

6.          var relevantNodes = ["H1", "H2", "H3", "H4", "H5", "H6", "P", "B", "I", "S", "STRONG", "INPUT", "BUTTON", "SELECT", "LABEL", "A", "LI", "SPAN"];  

7.    

8.          this.extractRelevantData = function extractRelevantData() {  

9.              // SPLIT PROCESS  

10.             var arrayOfElements = splitProcess();  

11.             // IDENTIFICATION PROCESS  

12.             var relevantElements = identificationProcess(arrayOfElements);  

13.             // CATEGORIZE PROCESS  

14.             return categorizeProcess(relevantElements);  

15.         };  

16.   

17.         /* 

18.         * SPLIT PROCESS 

19.         */  

20.         function splitProcess() {  

21.             var arrayOfAllElementsObj = [];  

22.             var arrayOfElements = document.querySelectorAll( 'body *' );  

23.             var i;  

24.             for (i = 0; i < arrayOfElements.length; ++i) {  

25.                 // Get current node element  

26.                 var currentNode = arrayOfElements[i];  

27.                 // Get tag name  

28.                 var currentTagName = $(currentNode).prop("tagName");  

29.                 // Get id of element  

30.                 var currentTagId = $(currentNode).prop("id");  

31.                 // Push node info into object  

32.                 var obj = {  

33.                     'node' : currentNode,  

34.                     'tagName' : currentTagName,  

35.                     'tagId' : currentTagId  

36.                 };  

37.                 arrayOfAllElementsObj.push(obj);  

38.             }  

39.             return arrayOfAllElementsObj;  

40.         }  

41.   

42.         /* 

43.         * IDENTIFICATION PROCESS 

44.         */  

45.         function identificationProcess(arrayOfElements) {  

46.             var relevantSetArray = [];  

47.             for (var i=0; i<arrayOfEleme...