 we will complete next session of embedded software testing unit to the testing methods lecture 14 these are important unit because this is an entire embedded software so we will be doing the detailed understanding and detailed example this is of different న్రార్ధ్టాయార్చి న్యత్బాప్టిన్ చాసందరినిసందావగాఫ్ి. చ్న్సి సుకార్చాయార్ఱరి. ఆమానిక్పటని.  Fey-be-rhytm మ్తాల గార కి. we will just have a glance of what we studied in equivalence partition, equivalence partition we know why we need because we cannot afford to have a numerous test cases simply because we have a possibility of putting tests with a different number of inputs because the system can behave in either a normal way or an abnormal way for a typical requirement we need to test only the sufficient levels of inputs how we can do that reduction is by having the partitioning that is called equivalence partitioning also we understood that the basic purpose to reduce the total number of test cases by partitioning the input conditions into finite number of equivalence classes so we also studied about the first level of valid and invalid test cases first we are going to define all the test cases then we are going to have a partition of one usual behavior what is expected for testing those inputs those are called valid equivalence partitioning the other one which is other than the normal behavior in terms of the outside the count or whatever it is those are called invalid partition and we define the numbers accordingly equivalent of valid one, valid two, valid three based on the classes and each class will have at least one test case selected from and we also studied an example of integer n ranging from minus nineteen to nineteen nine to plus nineteen nine so valid equivalence classes will have understand minus one so like this we have about five equivalence classes similarly we have about three to four invalid equivalence classes where we are going to input the values such a way that it is testing it is tested with an invalid range of inputs similarly another example of phone number we had studied and also we understood about guidance there are about three four five guidelines that are important in terms of time memory size range count etc we took a few more examples in terms of a temperature from fifteen to forty then we have a few level sensors having three types of indicators yellow or red green so we know that what is invalid what is valid so basically we are going to draw a range of all the test cases and against the range we are going to create a table it is called a trip table having all the possible combinations defined for each of that inputs with the help of different columns and the further we are going to have the equivalence classes divided as valid as per the below table we also know that we can have the output equivalence class if defined as well not only the input equivalence so that is about equivalence part today we will go through the black box testing technique called boundary value analysis so what is a boundary value analysis first we understood that the equivalence partitioning is done with the help of valid and invalid process we have valid well have the numerous number of test cases and black box within the first pi and the second pi has invalid test cases and the further we are going to prove them in terms of say this one set this other set this other set so like this we have say for valid some four are there for invalid error equivalence valid one then we have equivalence valid two then equivalence valid three similarly we have equivalence invalid one we have equivalence invalid two so equivalence invalid three here we have equivalence valid four there are four valid equivalence classes and three invalid equivalence classes so out of this group of valid classes we can select anyone which is appropriate for that particular system which is under test or that particular requirement which is under test now again we might have one or more covering within the equivalence class it is very important for us to understand that typical requirement behavior also because we need to see most of the requirements lying with a bounded values right like A and B so surrounding A and surrounding B how we are going to test it that also we need to consider which is nothing but the boundary value which will be subject to testing so continuation of the same equivalence partitioning here we have a boundary value analysis so we choose a selection this is what we have done of each group of equivalence classes varied or involved one test test we have selected you can see that round marked ones as the chosen test cases so if an input condition specifies a range bounded by values A and B test cases should be designed with value A and B and also just above A and just below B and just like this we are going to have it so the next slide so you can see there is a boundary of A just above A and just above B suppose the dot that is lying on the boundary we need to test with a value which is just above A just below A is what the first equivalence class similarly for our equivalence form we need to have it similarly for invalid classes also we need to have it the same way so which is nothing but the boundary value analysis so the first step is create test cases to test boundaries of equivalence classes for each identified boundary input and output create two test cases that means we know that two dots are here right for the boundary conditions two test cases definitely are going to be there one test case on each side of the boundary but both as close as possible to the actual boundary line that means how the system behaves for that boundary inputs one for the low one for the high or it could be one for the negative the other one could be for positive or one for the below another one for the above so likewise we are going to have boundary values defined so I will repeat again we have a valid and invalid classes we are going to define them as equivalence classes valid and invalid we have a selection criteria within that each one good test selection we are going to have it within the valid and invalid classes once we have that we are going to add further for the requirement which are lying with the bounded values with the help of this boundary inputs and outputs can see for each of the equivalence classes valid and invalid we have a boundary conditions defined next one is the test cases made by boundary value we will catch more types of errors you know why because the system behavior of the boundary could change suppose the system is supposed to take a variable of 1.0 to 5.0 and we are going to test 0.9 or we are trying to test 4.9 or 5.1 so system should behave exactly so it should be predictable basically the chance of catching errors or issues at the boundary is more actually that is why we need to have boundary value analysis but the disadvantage is that we will have more test cases on the other hand there will be more test cases which is more time consuming definitely it is a time consuming because we can qualify for each of the boundary conditions but it is equally important to identify the boundary value analysis test cases if you do boundaries only you have covered all the partitions as well that means definitely it is going to cover all the partitions but better to have an intermediate value along with the boundary conditions but what is said here is technically correct and maybe okay if everything is selected if the boundaries only are selected so better to the practice practice is to have an intermediate value along with the boundary means you have 1 to 10 as a requirement important it is good to have a boundary value analysis for 1 and 10 and an intermediate value such as 5 so how many test cases we will have for 1 we have a upper boundary and lower boundary as 2 test cases for 10 we have a upper boundary and lower boundary as 9 and 11 2 more test cases it will become for then an intermediate value that is nothing but the first one so totally 5 test cases for 1 to 10 if the test fails it is the whole partition is wrong it is not the test outcome or the test result it is the test enter test what we are trying to do within that partition if that fails that means there is a problem with that partition or is a boundary in the wrong place had a test made partition anyway testing only extremes may not give confidence for typical use scenarios especially for users we need to have an intermediate value a good value of like 5 when you consider ranges 1 to 10 usually the system works from 1 to 10 like 2 it could be 3 or 5 6 whatever it is so better to identify what intermediate value good example is we know the cost it is 0 to 20 but there are less chances that the driver always drives at a 0 speed there is very few seconds that driver drives more than 150 or 200 kilometers so trying it or testing it once at that boundary condition is good but it is very important that system as a car is stable when we are driving in the range around 40 to 60 kilometers so that is what is called as normal test scenarios that really gives a good confidence about the particular test time sometimes it may be difficult to set the policies why because we know that car speed is 0 to 50 but going with theory we may not be able to test it as 0 so how are you going to feel it so are you going to take it reverse it will definitely not show as minus 5 but we should have some simulation or some making which is going to be costlier why we need it is we need to test it in terms of theoretically the requirements whether it is collapse in the speed is less than 0 or likewise or the RPM it could be it could not be speed it could be engine RPM which goes beyond certain level what is the behavior of that likewise we need to have testing but to test that it may be challenging in terms of setting of the environment so we need to plan it appropriately so basically boundary value analysis is a requirement of class partitioning instead of choosing any representative for each equivalence class the main interest is focused on the boundaries for each of the class the idea is to select one test case for each boundary of the equivalence class the properties of test case that belongs to a defined equivalence class that it does a value that it is preferable on this one good value we need to select out of that class or at least reasonably close to the boundary of that particular equivalence class so the main reason why boundaries are important is that they are generally used by program also to control the execution of this program so programmers or the implementer would have implemented the boundary values as a boundary conditions which is less than greater than equal to etc so if that is a let us say RPM is 6000 to 7200 definitely he has considered the lowest value as well as the highest value while implementing the code so that is why we need to have the boundary value analysis so to control the execution or the implementer would have had this control of execution based on these values definitely he will have for implementing this if then case statements all this will be excited about the boundary value analysis so while doing this it is bound to happen that he could have implemented wrongly so we will study that what are those definitions and not that every month we test it twice there are two different equivalence classes and there will be test for the boundary in both these equivalence classes coverage is measured by dividing the number of executed cases so all these aspects we need to consider so in other terms we will detail out equivalence or boundary value analysis the idea behind this principle is that defects can be caused by simple programming errors related to error news or error news use of boundaries typically the programmer has coded less than should have been coded so that each boundary is tested with a minimum of two test cases that means the lower one the upper one the input value is equal to the boundary the one that is just beyond it so this way we are going to design the test so that it will identify the underneath issue of implementation so example let us see if a requirement says A less than B and in code it is implemented as A less than or equal to B then detection possibility is more with BVA than EP BVA means boundary value analysis EP is equal as partitioning so this will bring out the issue of boundary and that implementer has implemented wrong again it is A less than B like A less than or equal to B one more example if A less than B is implemented wrong only as A is also typically wrong then both EP and BVA could detect the error because the whole purpose of test itself will collapse here so definitely in any of the test definitely it is going to be caught the above one definitely it is valid but equal to condition lies for the boundary so it will be caught in the BVA the boundary value analysis then EP will not have understood that particular scenario for the equal condition so going with the earlier example what we discussed in the previous session 15 less than or equal to temperature which is less than or equal to 40 it means temperature lies between 15 and 40 it also includes 15 as well as 40 including 15 and 40 and assuming at all this of 0.1 in the temperature the boundary values to be selected are 14.9 15, 14 and 40.1 so these are the equivalence classes along with the boundary value so what are those invalid equivalence classes here we have 40.9 as invalid 40.1 as invalid 15 is a normal 40 is a valid because equal is there had equal not been there then we would have had a valid classes 39 suppose there is no equal to then instead of 15 we should have had a 14 as a valid equivalence class similarly if there was no equal for less than 40 then 39 would have been a valid equivalence class 40 would have been a invalid equivalence class and of course we have it also 0.1 definitely in terms of boundary we need to have the 0.1 is considered the lower side after applying it to the 15 we can have as well 15.1 here 39.9 right so these are some of the valid and invalid equivalence classes and the boundary value analysis so these two techniques are very important in terms of yes boundary value analysis is a requirement of equivalence class it should be known instead of choosing and representing from each equivalence class so that is the main thing about this so that is about boundary value analysis example of temperature let us look into some more example the same example what we had during equivalence partitioning n digit can take an input from minus 99 to plus 99 what are the boundary cases so that all will have it but out of which the boundary cases we have to select it as a valid or invalid equivalence class so let us focus on boundary cases so what is the boundary case for minus 99 less than or equal to again n means less than or equal to 9 so here are the boundary cases that we can have minus 100 98 of course minus 99 as well is a boundary case because it is on the exact edge of the lower boundary similarly we have minus standard minus 101 9 in tan 98 99 100 so this intermediate value is also because classes are arranged so we need to have this along with the boundary cases simple the next example is about one number so we will have boundary cases which are area code 8199 200, 201 at the lower boundary and at the higher boundary 98, 999 we know that 200, 199 198 as the boundary and the prefix at the higher boundary is with 98, 999 and 1000 and we have to fix any 4 digits so we should have 3 digits as input one suffix and 5 digits as other input suffixes so these are all some of the valid equivalence classes with boundary conditions which are allowed to test it so it is a very important aspect of boundary value analysis so we have gone to the example in general application of boundary value analysis can be done in a different manner normally we can select based on the input what the requirement is the requirement is a bit complicated having numerous inputs and outputs then better to have a defined truth table so instead of have a truth table identifying all the combinations first identify all the combinations then the next step is to go for identifying the boundary value analysis along with equivalence partitioning or equivalence partitioning is defined first then eliminate or add a complement to the equivalence partitioning with boundary conditions so that is what should be general behavior is especially important for complex so we know that we are going to address first the requirements how it can be tested if the requirement need and the requirement to support we may group that we know that how the grouping can be done that we have seen in our we need one the basic form of implementation in all but one of the variables that there nominal values and allowing the remaining variable to take on its extreme value that means nominal allowing the remaining variable to take as the extreme values the values used to test the extreme the below that means as we have seen in the previous example to be precise on we are going to have first the complex requirements these type of extremities so we are going to have a minimal we are going to have a minimal little more than that then nominal nominal is average or normal then we have a maximum maximum value then a maximum value little less than that so this is the extremities we are going to consider consider for arriving at forming the boundary value analysis we are going to have it this is one of the definitions that is used in this reference from one of the education issues okay boundary value analysis has a couple of important aspects we will discuss the next date problem the next date problem is a function of day month and year upon the input of certain date it returns the date of the day of that of the input the input variables have the obvious like below day should be 1 to 31 month should be 1 to 12 year should be 1812 to 2012 so this is the definition of the realistic date similarly we have clock also we can do so what is the next date problem we have to have here the year has been restricted so that these cases are not too large why because we know that the system can take 2012 so there are more complicated issues to consider when it is between variables these variables are very important so that the dependencies have to be considered for example there is never a 30% of input that means if we define the dependency of the date based on the month if you have a temporary or if you have a month so we are not going to have a 31 as an input so we cannot have a test case identifying a 31 month or any of the even month so no matter what year is where a 10 month are dependent so the nature of these dependencies for example is so useful to us all errors in the next date problem are denoted by invalid input date so very important thing also we need to understand is that we should be aware of the system requirements or user requirements or any realistic inputs why it is important is one value is dependent on the other one here we know the month is dependent on the date so the system which takes basically as an input it does not matter what year if you feed a month as April April cannot have a day as 31 so we cannot have a day as 31 in case of February or April etc so we need to have a selection such a way that selection should be dependent that means we need to understand what are the other circumstances very important not just enough to have a month just because the pay field takes 1 to 31 so also important to understand the other aspects of dependency in terms of the variables similarly let's define a clock so we have a hour minute and seconds so this again is an integer so we cannot go beyond 60 it will go for the next 4 similarly we go 24 so we will have the total over of 01 or 0 likewise we are going to have the issue of our next data problem so we need to have analysis of the bottom value important to have an understanding of the realistic inputs how we are going to feed for the bottom value analysis so we should not get stuck with the problem such as the next data problem one more user is bit tricky it is called triangle problem I will just go through simplistically so that this also can be considered so in fact the first introduction of the triangle problem in 73 by Goenberger there have been many more references to this problem since making this one of the most popular example to be used in conjunction with testing literature the triangle problem accepts three integers ABC as an input each of which is taken to be sides of a triangle that means we have three sides as well as equilateral and whatever you want to call so these three inputs are sides of triangle the values of these inputs are used to determine the type of the triangle so what type of a triangle these three inputs are going to decide so that triangle could be one of these like equilateral or equilateral or scaling or it is not at all a triangle so one of these is all factor based on the AB and C so for the inputs to be declared as being a triangle these must satisfy the six conditions so C1, C2, C3, C4 C5 so we have six conditions well before we started first of all we need to define it is being a triangle or not so to define that we need to have a triangle defined with condition 1 as A greater than or equal to 1 less than or equal to 200 B less than or equal to 1 sorry B greater than or equal to 1 and less than or equal to 200 similarly C between 1 and 200 then we have other binding conditions B less than B plus C and B should be less than A plus C C should be less than A plus B so these conditions basically should satisfy in order to form the triangle so otherwise this is never called as a triangle so the type of the triangle provided the conditions are met is determined as follows if all three sides are equal the output is equilateral exactly one pair of sides is equal the output is isosceles if no pair of sides is equal the output is skeleton after we define the triangle we are going to have what type of triangle so we need to be very careful in choosing the test fields also which should be realistic in terms of the inputs first of all we need to define the criteria how the requirement has been laid out first we need to understand that the tester has to have a good knowledge of the system under test we should not get stuck within the testing and the testing aspects are not good in terms of test selection technique or test design technique or strategy is not good first having understood the system we should design test cases such a way that the test is when behave in terms of executing and producing the output of the underneath embedded system okay so to conclude on the equivalence partitioning and boundary value analysis some important points that we need to see is these two are very effective testing techniques we have to have a mandatory equivalence partitioning and boundary value analysis we can find that boundary value analysis if practiced correctly is one of the most useful test design test case different methods so boundary value analysis have to be correctly practiced or implemented having considering all these issues and considering all the ranges considering the different examples that we have seen and the effectiveness of boundary conditions etc so if it is correctly practiced it will be very useful in terms of finding bugs in the underneath embedded software but as per the practice seen in the industry it is often used in effectively as the testers often see it is so simple they misuse it that means I believe that it is going to work because when I plug it I apply a power and it is behaving good and I do little changes good as a black box I feel that system is good and gives a calm mode that is not the case we should not consider that as a primary important rather we should think in terms of having a bug and I am going to challenge it in terms of bringing out all the issues or the tester would not have used it full potential if you get a mobile what basically user do as a user he will plug it he will plug it on he will try to dial so normal behavior so he gets the confidence that is fine but instead of using it at its full potential definitely he has to think out of the box in terms of testing it effectively so for testing it effectively he needs to understand what is capable of and what are the techniques that he can apply effectively and importantly so that will bring out all the test effects which are having issues in terms of implementation and these more vital are important why because boundary value analysis will bring the effective way of bringing out the bugs so VVA can provide relatively simple and formal testing that can be very powerful when used correctly that means we start formally with a simple technique of identifying the equivalence classes and identify the boundaries for each of the inputs that requirement or requirements identify then select the test based on these inputs select the criteria apply the test and find the test when issues are such as dependencies between variables or need of foresight into the system functionality we can find boundary analysis are restrictive that means example we take it as a next wave problem realistic boundary value should allow for a user to give month of April and day as particular but this is not a realistic input for an embedded system having a day as the implemented functionality we cannot expect that so restriction for boundary value analysis we should take a call in terms of boundary value analysis taking out the such cases for such issues so that is the conclusion of equivalence partitioning and boundary value analysis I will have some of the glossary in embedded software testing added to each slide in different sessions so we will just go through that acceptance testing we know that it is a formal testing from the user perspective actual result the result behavior of a system as a result of processing the inputs you know what is the behavior the combination of input values and the required response for a function of a system so that is the behavior the full specification of a function would normally comprise one or more behaviors you know what is black box testing test case selection based on the analysis of the specification of the component without reference to internal knowledge or internal implementation details in the black box and the white box we know about the logic and the program flow it is an alphabetical order let us say it is not tested all but we will use it every one my future sessions so boundary value and input value or output value which is on the boundary between equivalence cases or an incremental distance either side of the boundary it could be upper, below high or low etc so boundary value analysis is another test design technique as equivalence class for a component in which test cases are designed which improve representatives of boundary values certification the process of confirming that a system or component complies specified requirements and is acceptable for operational use so this is the IVMV response so we will talk about certification checklist is a list of questionnaires that can be answered this is basically used by support people for doing the IVMV independent validation verification mostly it will be done as a tool gate before the product is tested and released mostly it will be done by department from test QA okay so we have exercise question define the EP and VA test cases for the below example the below example says the refrigerator has a red and green indicator the optimal temperature between 3 and 8 degrees if the temperature is within this approval the green indicator is lit otherwise the red indicator is lit that means the indicator in the refrigerator will indicate if the temperature is between 3 and 8 if it is beyond that it will show it as red so we need to draw equivalence partition as well as boundary value analysis this is an exercise so one more exercise I think it is a continuation of the previous exercise you can see a diagram of the temperature indicator develop a BVA for the example right and green indicator the optimal temperature between 3 and 8 if the temperature is within this interval the green indicator is lit same thing the temperature range can be divided into three intervals so just few inputs accordingly you can define the boundary value analysis and the equivalence partitioning so from infinity it could be minus any value but without including the three which will result in red here down you can see 3 and below are red and 10 above are red between 3 and 8 is green thermometer or refrigerator the temperature indicator from 3 to 8 is green but not including it to the higher value is red so one more exercise this exercise was given in equivalence partition I will do an extension for this right equivalence class for below temperature is greater than 100 degree it says the value alert it says the value normal so right boundary class values for above tolerance with tolerance of plus or minus 1 degree that means less than 10 degree plus or minus 1 should be applied for doing the boundary value analysis so some of the embedded system of course we will go through we have defined all this in the previous sessions we are going to have IV and V robustness equivalence class, variated equivalence class, boundary analysis in the new words we have learned today we will see V angle problem next data problem is okay nominal average normal we will add it okay so we will add normal average all this meaning the same it is a type of input that is the boundary value analysis we are going to learn boundary value analysis and equivalence partition because the entire test design technique is founded with the help of these two techniques we will have this for the embedded software testing