Proposing SQL Statement Coverage Metrics: Difference between revisions

Line 38: Line 38:
Usernames typically consist of alphanumeric characters, underscores, periods and dashes. Passwords also typically consist of these character ranges and additionally allow for some other non-alphanumeric characters such as $, ^ or #. The authentication mechanism functions by a code segment resembling the one in Figure 4. Assume there exists some table maintaining a list of all usernames, passwords, and most likely some indication of the role of each unique username.
Usernames typically consist of alphanumeric characters, underscores, periods and dashes. Passwords also typically consist of these character ranges and additionally allow for some other non-alphanumeric characters such as $, ^ or #. The authentication mechanism functions by a code segment resembling the one in Figure 4. Assume there exists some table maintaining a list of all usernames, passwords, and most likely some indication of the role of each unique username.


<code>
   //for simplicity, this example is given in PHP.  
   //for simplicity, this example is given in PHP.  
   //first, extract the input values from the form  
   //first, extract the input values from the form  
Line 53: Line 52:
   //set a cookie for the user with their role  
   //set a cookie for the user with their role  
   setcookie(“userrole”, $role);  
   setcookie(“userrole”, $role);  
</code>
 
<center>'''Figure 4. Example authentication code'''</center>
<center>'''Figure 4. Example authentication code'''</center>