ATS Automated Test Software Style Guide Brian Jackson Test Technologies EDCS-30
ATS Automated Test Software Style Guide Brian Jackson Test Technologies EDCS-303404 Version: 1.5 Approved February 3, 2004 Abstract This document describes the Cisco Test Technologies style convention standards for development of ATS automated test scripts and procedure libraries. ATS Automated Test Software Style Guide Copyright © 2004 Cisco Systems, Inc. All rights reserved. Cisco Confidential — For Internal Use Only Table of Contents 1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 2 Quoting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2.1 Quoting for Variable, Command, and Special-Character Substitution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2.2 Quoting for Variable, Command, and Special-Character Suppression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2.3 Default to the Use of Double Quotes to Quote Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2.4 Quote Single-Element Strings Using Double Quotes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 2.5 Quote Expressions Using Curly Braces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 2.5.1 Quote Expressions Using Curly Braces to Maintain Consistency . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 2.5.2 Quote Expressions Using Curly Braces to Improve Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.5.3 Quote Looping Expressions Using Curly Braces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.6 Quote Code Blocks Using Curly Braces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 2.7 Quote Procedure Bodies and Script Sections Using Curly Braces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.8 Quote Non-Space-Delimited Variable Names Using Curly Braces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.9 Quote Procedure Argument Lists Using Curly Braces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 3 Commands and Code Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 3.1 Command Placement and Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 3.1.1 Code One Command per Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 3.1.2 Split Lengthy Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 3.1.2.1 Split Command Lines That Exceed 80 Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 3.1.2.2 Use join to Split Strings That Exceed 80 Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 3.1.2.3 Split Commands at Logical Breaks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3.2 Code Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3.2.1 Quote Code Blocks Using Curly Braces (Reminder) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3.2.2 Align Opening and Closing Code Block Curly Brace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3.2.3 Indent the Contents of Code Blocks Four Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 3.2.4 Avoid Excessively Long or Deeply Nested Code Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . uploads/s3/ ats-automated-test-software-style-guide-brian-jackson-test-technologies.pdf
Documents similaires
-
80
-
0
-
0
Licence et utilisation
Gratuit pour un usage personnel Attribution requise- Détails
- Publié le Aoû 12, 2021
- Catégorie Creative Arts / Ar...
- Langue French
- Taille du fichier 0.1893MB