Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Big iron lessons, Part 2: Reliability and availability: What's the difference?

Reliability, availability, and serviceability design considerations for the system architect

Return to article


Listing 1. Simple C code with two paths and MCDC testing requirements
#define UPPER_LIMIT 100
#define TRUE 1
#define FALSE 0

extern void logMessage(char *msg);
extern unsigned int MMIORead(unsigned int addr);
extern void StartRecovery(void);
extern void ContinueOperation(void);
extern int RecoveryRequired;

int LimitTest(unsigned int val)
{
     if(val > UPPER_LIMIT)
     {
              logMessage("Limit Exceeded\n");
              return TRUE;
     }     
     else
     {
              return FALSE;
      }
 }
   
main()
{ 
      unsigned int IOValue = 0;
      
      IOValue = MMIORead(0xF0000100);
      
      if(RecoveryRequired || LimitTest(IOValue))
      {
               StartRecovery();
       }     
       else
       {
               ContinueOperation();
       }
}

Return to article