{"id":8924,"date":"2021-03-16T15:48:26","date_gmt":"2021-03-16T10:18:26","guid":{"rendered":"https:\/\/www.h2kinfosys.com\/blog\/?p=8924"},"modified":"2025-12-10T06:36:28","modified_gmt":"2025-12-10T11:36:28","slug":"model-based-testing","status":"publish","type":"post","link":"https:\/\/www.h2kinfosys.com\/blog\/model-based-testing\/","title":{"rendered":"Model Based Testing"},"content":{"rendered":"\n<p>Model based Testing is a <a href=\"https:\/\/www.h2kinfosys.com\/courses\/qa-online-training-course-details\/\">Software testing<\/a> technique which checks the run time behaviour of the software under test and is checked against predictions made by the model. A Model is known as description of the system\u2019s behavior and behavior can be described in terms of input sequences, actions, conditions, flow of data from input to output. It should be practically understandable and can be reusable, shareable, must have a precise description of the system under test.<\/p>\n\n\n\n<p>There are many models available and also describe different aspects of the system behavior. Examples are:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Data Flow\u00a0<\/li>\n\n\n\n<li>Control Flow<\/li>\n\n\n\n<li>Dependency Graph<\/li>\n\n\n\n<li>Decision Tables<\/li>\n\n\n\n<li>State Transition Machines<\/li>\n<\/ol>\n\n\n\n<p><a href=\"https:\/\/www.h2kinfosys.com\/blog\/model-based-testing\/\" class=\"rank-math-link\">Model Based testing<\/a> also explains how the system behaves in response to an action. Supply chain and see if the system responds as per the expectations.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2021\/03\/image-17-1024x576.png\" alt=\"\" class=\"wp-image-32760\" style=\"aspect-ratio:1.7752112676056337;width:570px;height:auto\" title=\"\" srcset=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2021\/03\/image-17-1024x576.png 1024w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2021\/03\/image-17-300x169.png 300w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2021\/03\/image-17-768x432.png 768w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2021\/03\/image-17-1536x864.png 1536w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2021\/03\/image-17-150x84.png 150w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2021\/03\/image-17.png 1600w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Consider an example which explains the simplified approach of writing poetry in the notepad and also possible action related to each step. For each and every action, test case which can be generated and also output is verified.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Types of Model based Testing<\/strong><\/h2>\n\n\n\n<h4 class=\"wp-block-heading\">Basically there are two types:<\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Offline\/a priori: Generation of Test suites before executing it. A test suite is the collection of test cases.<\/li>\n\n\n\n<li>Online\/On-the-Fly: Generation of test suites during Test execution.<\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Different models in Testing:<\/strong><\/h4>\n\n\n\n<p>In order to understand the model based testing it is necessary to understand some of the models.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>1. Finite State Machines<\/strong><\/h2>\n\n\n\n<p>This model helps testers to assess the result depending on the input selected. There can be various combinations of the input which results in a corresponding state of the system. This system is governed by a group of inputs given from of testers. For example, system which allows employees to log into the application. In a current state, the employee is \u201cOut\u201d and it becomes \u201cIn\u201d once he signs-into the system. Under the \u201cin\u201d state an employee can view, print, scan documents in the system.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2. <strong>State Charts<\/strong><\/h2>\n\n\n\n<p><strong><\/strong>It is a continuation of Finite State Machine and can be used for complex and real time systems. State charts are used to explain various behaviours of the system. It is having the definite number of states. The behaviour of the system is analysed and represented in the form of events for each state.<\/p>\n\n\n\n<p>Example: Defects are created in <a href=\"https:\/\/en.wikipedia.org\/wiki\/Test_management_tool\" class=\"rank-math-link\" rel=\"nofollow noopener\" target=\"_blank\">defect management tool<\/a> with the status as NEW. Once it is fixed by the developers; it has to be changed to status Fixed. If a defect is not fixed, change status to re-open. State Chart should be designed in such a way that it must call for an event for each state.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img decoding=\"async\" width=\"1024\" height=\"745\" src=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2021\/03\/image-18-1024x745.png\" alt=\"\" class=\"wp-image-32761\" style=\"aspect-ratio:1.3745940832033547;width:515px;height:auto\" title=\"\" srcset=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2021\/03\/image-18-1024x745.png 1024w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2021\/03\/image-18-300x218.png 300w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2021\/03\/image-18-768x559.png 768w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2021\/03\/image-18-150x109.png 150w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2021\/03\/image-18.png 1200w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>3. Unified Modelling Language (UML):<\/strong>&nbsp;<\/h2>\n\n\n\n<p>It is a standardised general-purpose modelling language. UML includes a group of graphic notation techniques to create visual models of that can describe very complicated behaviour of the system.<\/p>\n\n\n\n<p>UML notation:<\/p>\n\n\n\n<p>It has activities like<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Actors<\/li>\n\n\n\n<li>Activities<\/li>\n\n\n\n<li>Business Process<\/li>\n\n\n\n<li>Components<\/li>\n\n\n\n<li>Programming Languages<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Challenges faced by the Model based testing:<\/strong><\/h2>\n\n\n\n<p>Movement in Model Based Testing in every organization obviously requires a high amount of investments and effort. The drawbacks of MBT in software engineering are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Required Skills\u00a0 in testers<\/li>\n\n\n\n<li>Learning time will be more<\/li>\n\n\n\n<li>It is difficult to understand the model itself.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Advantages:<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>It is easy test case<\/li>\n\n\n\n<li>it improves test coverage<\/li>\n\n\n\n<li>It can Run different tests on number of machines<\/li>\n\n\n\n<li>Early defect detection<\/li>\n\n\n\n<li>Increase in defect count<\/li>\n\n\n\n<li>Cost is reduced.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Model based Testing is a Software testing technique which checks the run time behaviour of the software under test and is checked against predictions made by the model. A Model is known as description of the system\u2019s behavior and behavior can be described in terms of input sequences, actions, conditions, flow of data from input [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":8942,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-8924","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-qa-tutorials"],"_links":{"self":[{"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/posts\/8924","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/comments?post=8924"}],"version-history":[{"count":1,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/posts\/8924\/revisions"}],"predecessor-version":[{"id":32762,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/posts\/8924\/revisions\/32762"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/media\/8942"}],"wp:attachment":[{"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/media?parent=8924"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/categories?post=8924"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/tags?post=8924"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}