Before we start learning a programming language to give instructions to computers to develop software, we need to learn about how computers are built. If you were to take apart your computer or cell phone and look deep inside, you would find the following parts: Show
Figure 10: Computer Hardware Architecture The high-level definitions of these parts are as follows:
While most of the detail of how these components work is best left to computer builders, it helps to have some terminology so we can talk about these different parts as we write our programs. As a programmer, your job is to use and orchestrate each of these resources to solve the problem that you need to solve and analyze the data you get from the solution. As a programmer you will mostly be “talking” to the CPU and telling it what to do next. Sometimes you will tell the CPU to use the main memory, secondary memory, network, or the input/output devices. It is essential that computer hardware be reliable and error free. If the hardware gives incorrect results, then any program run on that hardware is unreliable. The key to developing reliable systems is to keep the design as simple as possible[1]. In digital computing, all information is represented as a series of digits or electronic symbols which are either “on” or “off” (similar to a light switch). These patterns of electronic symbols are best represented as a sequence of zeroes and ones, digits from the binary (base 2) number system. Figure 11: Digital Representation The term bit stands for binary digit. Therefore, every bit has the value 0 or 1. A byte is a group of bits operated on as a single unit in a computer system,
usually consisting of eight bits. Although values represented in base 2 are significantly longer than those represented in base 10, binary representation is used in digital computing because of the resulting simplicity of hardware
design[2]. For example, the decimal number An operating system is software that has the job of managing and interacting with the hardware resources of a computer. Because an operating system is intrinsic to the operation a computer, it is referred to as system software. An operating system acts as the “middle man” between the hardware and executing application programs (see Figure 12). For example, it controls the allocation of memory for the various programs that may be executing on a computer. Operating systems also provide a particular user interface. Thus, it is the operating system installed on a given computer that determines the “look and feel” of the user interface and how the user interacts with the system, and not the particular model computer. [3] It can be very cumbersome, error prone, and time consuming to converse with a computer using only zeros and ones. Numerical machine code (computer code using only zeros and ones) does exist but is rarely used by programmers. For that reason most people program using a “higher-level” programming language which use words and symbols that are easier for humans to manage than binary sequences. Tools exist that automatically convert a higher-level description of what is to be done into the required lower-level, machine code. Higher-level programming languages like Python allow programmers to express solutions to programming problems in terms that are much closer to a natural language like English. Some examples of the more popular of the hundreds of higher-level programming languages that have been devised over the past 60 years include FORTRAN, COBOL, Lisp, Haskell, C++, Perl, C , Java, and C#. Most programmers today, especially those concerned with high-level applications, usually do not worry about the details of underlying hardware platform and its machine language. Sample numerical machine code: Fortunately, higher-level programming languages provide a relatively simple structure with very strict rules for forming statements, called the programming language syntax, which can express a solution to any problem that can be solved by a computer. Consider the following program fragment written in the Python programming language:
While these three lines (three statements) do constitute a proper Python program, they are more likely a small piece of a larger program.
The lines of text in this program fragment look similar to expressions in algebra. We see no sequence of binary digits. Three words, The beauty of higher-level languages is this: the same Python source code can execute on different target platforms. The target platform must have a Python interpreter available, but multiple Python interpreters are available for all the major computing platforms. The human programmer therefore is free to think about writing the solution to the problem in Python, not in a specific machine language. Programmers have a variety of tools available to enhance the software development process. Some common tools include:
The tall boy runs quickly to the door. uses proper English syntax. By comparison, the sentence Boy the tall runs door to quickly the. is not correct syntactically. It uses the same words as the original sentence, but their arrangement does not follow the rules of English. Similarly, programming languages have strict syntax rules that programmers must follow to create well-formed programs. Only well-formed programs are acceptable for translation into executable machine code. Some syntax-aware editors can use colors or other special annotations to alert programmers of syntax errors during the editing process.
The Python interpreter is written in a high-level language called “C”. You can look at the actual source code for the Python interpreter by going to www.python.org and working your way to their source code. So Python is a program itself and it is compiled into machine code. When you install Python on your computer, you copy a machine-code copy of the translated Python program onto your system. In Windows, the executable machine code for Python itself is likely in a file with a name like:
Table 1: Compiler Vs Interpreter[4] Many developers use integrated development environments (IDEs). An IDE includes editors, debuggers, and other programming aids in one comprehensive program. Python IDEs include Wingware, PyCharm,, and IDLE. Despite the wide variety of tools (and tool vendors’ claims), the programming process for all but trivial programs is not automatic. Good tools are valuable and certainly increase the productivity of developers, but they cannot write software. There are no substitutes for sound logical thinking, creativity, common sense, and, of course, programming experience. Guido van Rossum created the Python programming language in the late 1980s. He named the language after the BBC show “Monty Python’s Flying Circus”. In contrast to other popular languages such as C, C++ , Java, and C#, Python strives to provide a simple but powerful syntax. Python is used for software development at companies and organizations such as Google, Yahoo, Facebook, CERN, Industrial Light and Magic, and NASA. It is especially relevant in developing information science applications such as ForecastWatch.com which uses Python to help meteorologists, online travel sites, airline reservation systems, university student record systems, air traffic control systems among many others[5]. Experienced programmers can accomplish great things with Python, but Python’s beauty is that it is accessible to beginning programmers and allows them to tackle interesting problems more quickly than many other, more complex languages that have a steeper learning curve. Python has an extensive Standard Library which is a collection of built-in modules, each providing specific functionality beyond what is included in the “core” part of Python. (For example, the math module provides additional mathematical functions. The random module provides the ability to generate random numbers)[6]. Additionally the Standard Library can help you do various things involving regular expressions, documentation generation, databases, web browsers, CGI, FTP, email, XML, HTML, WAV files, cryptography, GUI (graphical user interfaces), among other things. More information about Python, including links to download the latest version for Microsoft Windows, Mac OS X, and Linux, can be found in Appendix A of this book and also at http://www.python.org . In late 2008, Python 3.0 was released. Commonly called Python 3, the current version of Python, VERSION 3.0, is incompatible with earlier versions of the language. Many existing books and online resources cover Python 2, but more Python 3 resources now are becoming widely available. The code in this book is based on Python 3. This book does not attempt to cover all the facets of the Python programming language. The focus here is on introducing programming techniques and developing good habits and skills. To that end, this approach avoids some of the more obscure features of Python and concentrates on the programming basics that easily transfer directly to other programming languages. The goal is to turn you into a person who is skilled in the art of programming. In the end you will be a programmer – perhaps not a professional programmer, but at least you will have the skills to look at a data/information analysis problem and develop a program to solve the problem. In a sense, you need two skills to be a programmer:
Once you learn one programming language such as Python, you will find it much easier to learn a second programming language such as JavaScript or C++ . Other programming languages have very different vocabulary and grammar (syntax) but the problem-solving skills will be the same across all programming languages. You will learn the “vocabulary” and “sentences” (the syntax) of Python pretty quickly. It will take longer for you to be able to write a coherent program to solve a new problem. We learn programming much like we learn writing. We start by reading and explaining programs, then we write simple programs, and then we write increasingly complex programs over time. At some point you “get your muse” and see the patterns on your own and can see more naturally how to take a problem and write a program that solves that computational problem. And once you get to that point, programming becomes a very pleasant and creative process. We start with the vocabulary and structure of Python programs. Be patient as the simple examples remind you of when you started reading for the first time. The text that makes up a Python program has a particular structure. The syntax must be correct, or the interpreter will generate error messages and not execute the program. This section introduces Python by providing a simple example program. A program consists of one or more statements. A statement is an instruction that the interpreter executes. The following statement invokes the print function to display a message:
We can use the statement in a program. Figure 13 ( Figure 13: Listing of simple.py IDLE is Python’s Integrated Development and Learning Environment (IDE) and is included as part of the Python Standard Library which is distributed with Python 3 (See Appendix A). IDLE is the standard Python development environment. Its name is an acronym of “Integrated DeveLopment Environment”. It works well on both Unix and Windows platforms. IDLE has a Python Shell window, which gives you access to
the Python interactive mode. It also has a file editor that lets you create and edit existing Python source files. The file editor was used to write the The way you launch IDLE depends on your operating system and how it was installed. Figure 13 shows a screenshot of IDLE running on a Windows 8.1 computer. The IDE consists of a simple menu bar at the top. Other Python IDEs are similar in appearance. To begin entering our program, we just type in the Python
statements. To start a new program, choose the New File item from the File menu. This action produces a new editor pane for a file named Figure 14: New File Editor Window We now are ready to type in the code that constitutes the program.
Next we will save the file. The menu sequence FileSave or File Save As, produces the dialog box shown in Figure 15 that allows us to select a folder and filename for our program. You should be sure all Python programs are saved with a Figure 15: Save Python File, Option 1 If you are using a different text editor select “Save as Type: All files” and add the Figure 16: Save Python File, Option 2 We can run the program by selecting the menu sequence Run –> Run Module or use the shortcut key F5. A new window labeled Python Shell will display the program’s output. Figure 17 shows the results of running the program. Figure 17: Program simple.py Output This program contains one Python statement. A statement is a command that the interpreter executes. This statement prints the message Note to Reader: In the context of programming, a function is a named sequence of statements that
performs a computation. The name of the function here is When you type a statement on the command line in the Shell window and select the Enter key, Python executes it. Statements alone don’t produce any result. We created the program in Figure 13 (simple.py) and submitted it to the Python interpreter for execution. We can interact with the interpreter directly, typing in Python statements and expressions for immediate execution. As we saw in Figure 17, the IDLE window labeled Python Shell is where the executing program directs its output. We also can type commands into the Python Shell window, and the interpreter will attempt to execute them. Figure 18 shows how the interpreter responds when we enter the program statement directly into the Shell. The interpreter prompts the user for input with three greater-than symbols (>>>). This means the user typed in the text on the line prefixed with >>>. Any lines without the >>> prefix represent the interpreter’s output, or feedback, to the user. We will find Python’s interactive interpreter invaluable for experimenting with various language constructs. Figure 18: Executing Individual Commands in the Python Shell We can discover many things about Python without ever writing a complete program. We can execute the interactive Python interpreter directly from the command line in the Python Shell. The interpreter prompt (>>>) prefixes all user input in the interactive Shell. Lines that do not begin with the >>> prompt represent the interpreter’s response.If you try to enter each line one at a time into the interactive Shell, the program’s output will be intermingled with the statements you type. In this case the best approach is to type the program into an editor, save the code you type to a file, and then execute the program. Most of the time we use an editor to enter and run our Python programs. The interactive interpreter is most useful for experimenting with small snippets of Python code. Note to Reader: The print() function always ends with an invisible “new line” character ( \n ) so that repeated calls to print will all print on a separate line each. To prevent this newline character from being printed, you can specify that it should end with a blank: Figure 19: First Computer Bug (Image ©Courtesy of the Naval Surface Warfare Center, Dahlgren, VA., 1988. NHHC Collection) Programming is a complex process, and because it is done by human beings, it often leads to errors. Programming errors are called bugs and the process of tracking them down and correcting them is called debugging. The story behind this term dates back to September 9, 1947, when Harvard’s Mark II Aiken Relay computer was malfunctioning. After rooting through the massive machine to find the cause of the problem, Admiral Grace Hopper, who worked in the Navy’s engineering program at Harvard, found the bug. It was an actual insect. The incident is recorded in Hopper’s logbook alongside the offending moth, taped to the logbook page: “15:45 Relay #70 Panel F (moth) in relay. First actual case of bug being found.”[7] Three kinds of errors can occur in a program: syntax errors, runtime errors, and semantic errors. It is useful to distinguish between them in order to track them down more quickly. Syntax errorsPython can only execute a program if the program is syntactically correct; otherwise, the process fails and returns an error message. Syntax refers to the structure of a program and the rules about that structure. For example, in English, a sentence must begin with a capital letter and end with a period. this
sentence contains a syntax error. For most readers, a few syntax errors are not a significant problem, which is why we can read the poetry of E. E. Cummings without problems. Python is not so forgiving. If there is a single syntax error anywhere in your program, Python will display an error message and quit, and you will not be able to run your program. Early on, you will probably spend a lot of time tracking down syntax errors. As you gain experience, though, you will make fewer errors and find them faster. Runtime errorsThe second type of error is a runtime error, so called because the error does not appear until you run the program. These errors are also called exceptions because they usually indicate that something exceptional (and bad) has happened. Runtime errors are rare in the simple programs you will see in the first Units, so it might be a while before you encounter one. Semantic errorsThe third type of error is the semantic error. If there is a semantic error in your program, it will run successfully, in the sense that the computer will not generate any error messages and quit, but it will not do the right thing. It will do something else. Specifically, it will do what you told it to do. The problem is that the program you wrote is not the program you wanted to write. The meaning of the program (its semantics) is wrong. Identifying semantic errors can be tricky because it requires you to work backward by looking at the output of the program and trying to figure out what it is doing. The test cases we generated in UNIT #1 helps programmers fix semantic errors. Experimental debuggingOne of the most important skills you will acquire is debugging. Although it can be frustrating, debugging is one of the most intellectually rich, challenging, and interesting parts of programming. In some ways, debugging is like detective work. You are confronted with clues, and you have to infer the processes and events that led to the results you see. Debugging is also like an experimental science. Once you have an idea what is going wrong, you modify your program and try again. If your hypothesis was correct, then you can predict the result of the modification, and you take a step closer to a working program. If your hypothesis was wrong, you have to come up with a new one. For some people, programming and debugging are the same thing. That is, programming is the process of gradually debugging a program until it does what you want. The idea is that you should start with a program that does something and make small modifications, debugging them as you go, so that you always have a working program. Just printing a single sentence is not enough, is it? You want to do more than that – you want to take some input, manipulate it and get something out of it. We can achieve this in Python using constants and variables, and we’ll learn some other concepts as well in this section. CommentsComments are any text to the right of the # symbol and is mainly useful as notes for the reader of the program. For example:
OR
Use as many useful comments as you can in your program to:
Code tells you how, comments should tell you why. This is useful for readers of your program so that they can easily understand what the program is doing. Consider the programmer, newly hired, who has been assigned the job of maintaining a 2000 line-of-code program. Without comments the codes can be very difficult to understand let alone maintain. Literal ConstantsAn example of a literal constant is a number like It is called a literal because it is literal – you use its value literally. The number 2 always represents itself and nothing else – it is a constant because its value cannot be changed. Hence, all these are referred to as literal constants. NumbersNumbers are mainly of two types – integers and floats. An example
of an integer is 2 which is just a whole number. Examples of floating point numbers (or floats for short) are StringsA string is a sequence of characters. Strings can be a single character, a single word or a bunch of words. You will be using strings in many Python programs that you write. Note the following: Single Quote: You can specify (define) strings using single quotes such as Double Quotes: Strings in double quotes work exactly the same way as strings in single quotes. An example is Triple Quotes: You can specify multi-line strings using triple quotes – ( “”” or ”’ ). You can use single quotes and double quotes freely within the triple quotes. An example is:
Strings are immutable. This means that once you have created a string, you cannot change it. Although this might seem like a bad thing, it really isn’t. We will see why this is not a limitation in the various programs that we see later on. VariablesUsing just literal constants can soon become boring – we need some way of storing any information and manipulate them as well. This is where variables come into the picture. Variables are exactly what the name implies – their value can vary, i.e., you can store anything using a variable. Variables are just parts of your computer’s memory where you store some information. Unlike literal constants, you need some method of accessing these variables and hence you give them names. One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value.
The assignment statement gives a value to a variable: This example makes three assignments. The first
assigns the string value The assignment symbol, =, should not be confused with equals, which uses the symbol ==. The assignment statement binds a name, on the left-hand side of the operator, to a value, on the right-hand side. This is why you will get an error if you enter:
Tip: When reading or writing code, say to yourself “n is assigned 17” or “n gets the value 17”. Don’t say “n equals 17”. A common way to represent variables on paper is to write the name with an arrow pointing to the variable’s value. This kind of diagram is called a state snapshot because it shows what state each of the variables is in at a particular instant in time. (Think of it as the variable’s state of mind). The following diagram shows the result of executing the assignment statements: message → “What is today’s date?” If you ask the interpreter to evaluate a variable in the Python Shell, it will produce the value that is currently linked to the variable:
We use variables in a program to “remember” things, perhaps the current score at the football game. But variables are variable. This means they can change over time, just like the scoreboard at a football game. You can assign a value to a variable, and later assign a different value to the same variable. (This is different from mathematics. In mathematics, if you give `x` the value 3, it cannot change to link to a different value half-way through your calculations!). For example:
You’ll notice we changed the value of day three times, and on the third assignment we even made it refer to a value that was of a different data type. A great deal of programming is about having the computer remember things, e.g. The number of missed calls on your phone, and then arranging to update or change the variable when you miss another call. Note to Reader: There are two common variable genres that are used in computer programming. They are so regularly used that they have special names. accumulator: A variable used in a loop to add up or accumulate a result. counter: A variable used to count something, usually initialized to zero and then incremented. Identifier NamingVariables are examples of identifiers. Identifiers are names given to identify something. There are some rules you have to follow for naming identifiers:
Python keywords define the language’s syntax rules and structure, and they cannot be used as variable names. Python has thirty-something keywords (and every now and again improvements to Python introduce or eliminate one or two):
Table 2: Python Keywords You might want to keep this table handy. If the interpreter complains about one of your variable names and you don’t know why, see if it is in this table. Programmers generally choose names for their variables that are meaningful to the human readers of the program — they help the programmer document, or remember, what the variable is used for. Note to Reader: IndentationWhitespace is important in Python. Actually, whitespace at the beginning of the line is important. This is called indentation. Leading whitespace (spaces and tabs) at the beginning of the logical line is used to determine the indentation level of the logical line, which in turn is used to determine the grouping of statements. This means that statements which go together must have the same indentation. Each such set of statements is called a block. We will see examples of how blocks are important in later sections and Units. One thing you should remember is that wrong indentation can give rise to errors. For example:
When you run this, you get the following error:
Notice that there is a single space at the beginning of the second line. The error indicated by Python tells us that the syntax of the program is invalid i.e. the program was not properly written. What this means to you is that you cannot arbitrarily start new blocks of statements (except for the default main block which you have been using all along, of course). Cases where you can use new blocks (such as the iteration control structure) will be detailed in later Units. How to indent: Use four spaces for indentation. This is the official Python language recommendation. Good editors (including IDLE) will automatically do this for you. Make sure you use a consistent number of spaces for indentation, otherwise your program will not run or will have unexpected behavior. Practice: Type, save and run the following program,var.py, using the Python editor.
Output:
Let us examine how this program works.
Most statements (logical lines) that you write will contain expressions. A simple example of an expression is Operators are functionality that do something and can be represented by symbols such as + or by special keywords. Operators require some data to operate on and such data is called operands. In this case, When a variable name appears in the place of an operand, it is replaced with its value before the operation is performed. We will briefly take a look at the operators and their usage. Note that you can evaluate the expressions given in the examples using the interpreter interactively. For example, to test the expression 2+3 , use the interactive Python interpreter prompt in the Shell window:
Here is a quick overview of the available operators:
Table 3: Python Operators Some of the comparison operators work on strings. For example the + operator (plus) works with strings, but it is not addition in the mathematical sense. Instead it performs concatenation, which means joining the strings by linking them end to end. The * operator also works on strings; it performs repetition. For example,
Python does not handle uppercase and lowercase letters the same way that people do. All the uppercase letters come before all the lowercase letters, so: the word, Zebra, comes before apple. A common way to address this problem is to convert strings to a standard format, such as all lowercase, before performing the comparison. Practice #1Use the Python IDLE Shell to calculate:
Practice #2So now let us convert 645 minutes into hours. Use IDLE’s Python Shell to type in the following:
Oops! The output gives us 10.75 which is not what we expected. In Python 3, the division operator / always yields a floating point result. What we might have wanted to know was how many whole hours there are, and how many minutes remain. Python gives us two different flavors of the division operator. The second, called floor division uses the token //. Its result is always a whole number — and if it has to adjust the number it always moves it to the left on the number line. So 6 // 4 yields 1, but -6 // 4 might surprise you! Practice#3Try this:
Take care that you choose the correct flavor of the division operator. If you’re working with expressions where you need floating point values, use the division operator that does the division accurately. If you had an expression such as Recall from Algebra PEMDAS (parenthesis, exponents, multiplication, division, addition, subtraction).This tells us that the multiplication should be done first and that the multiplication operator has higher precedence than the addition operator. It is far better to use parentheses to group operators and operands appropriately in order to explicitly specify the precedence. This makes the program more readable. For example, There is an additional advantage
to using parentheses – it helps us to change the order of evaluation. For example, if you want addition to be evaluated before multiplication in an expression, then you can write something like Practice #4Use the Python editor to enter the following code (save as
Output: Let us examine how this program works.
Recall from our previous Unit the example input-process-output diagram for the algorithm we called find_max. Figure 20: Input-Process-Output for Finding the Largest Number We can represent any solution to a computational problem using this pattern of identifying the input (the data we are given) and then the general process that must be completed to get the desired output. We have used Python statements invoking the print function to display a string of characters (i.e. the “message”).
For starters, the built-in function print() will be used to print the output for our programs.
There is also a built-in function in Python for getting input from the user: A sample run of this script in IDLE’s Python Shell would pop up a window like this: Figure 21: Using the Built-in Function input() The user of the program can enter the name and click OK (the Enter key), and when this happens the text that has been entered is returned from the Even if you asked the user to enter their age, you would get back a string like Here we’ll look at three more built-in Python functions, The int function can take a floating point number or a string, and turn it into an int. For floating point numbers, it discards the decimal portion of the number — a process we call truncation towards zero on the number line. For example:
This last type conversion case doesn’t look like a number — what do we expect?
The type converter float() can turn an integer, a float, or a syntactically legal string into a float:
The type converter str() turns its argument into a string:
If you are not sure what class a value falls into (i.e. unsure whether a value is an integer, a float or a string), Python has a built-in function called type which can tell you.
As mentioned in Unit #1, Python has an extensive Standard Library which is a collection of built-in modules, each providing specific functionality beyond what is included in the “core” part of Python. A Python module is simply a file that contains Python code. The name of the file dictates the name of the module; for example, a file named math.py contains the functions available from the standard math module. We will explore this module (math) here. Math Module and Math FunctionsPython has a math module that provides most of the familiar mathematical functions. Before we can use the module, we have to import it: >>> import math This statement creates a module object named math. The following is a partial list of the functions which are provided by this module.
Many math operations depend on special constants also provided by the math module.
Some examples of using the math module functions (note: these functions require the library name followed by a period followed by the function name):
Additional useful mathematical built-in functions besides
More examples of math functions (no need to import the
We have seen how to print strings and how to get a string as input from a user. We also saw how to ‘add’ strings (concatenate) and ‘multiply’ strings.
Processing of data includes the manipulation of strings (which is data) to produce something (information) which is meaningful. For example we might be presented with a file of thousands of passwords in use at a privately owned company and we would like to determine which of these passwords are secure and those that are not secure. Recall that a string is a merely sequence of characters. To determine if an individual password was secure or not we might want to look at the length of the password and the individual characters in the password, looking for characters such as uppercase, numeric, special characters, etc. Strings are actually a type of sequence; a sequence of individual characters. The indexing operator (Python uses square brackets to enclose the index) selects a single character substring from a string:
The expression If we want to access the zero-eth letter of a string, we just place 0, or any expression that evaluates to 0, in between the brackets:
The expression in brackets is called an index. An index specifies a member of an ordered collection, in this case the collection of characters in the string. The index indicates which one you want, hence the name. It can be any integer expression. Note that indexing returns a string — Python has no special type for a single character. It is just a string of length 1. The string method
At some point, you may need to break a large string (i.g a paragraph) down into smaller chunks, or strings. This is the opposite of concatenation which merges or combines strings into one. To do this, you use the
If no separator is defined when you call upon the function, whitespace will be used by default (as seen above). In simpler terms, the separator is a defined character that will be placed between each variable. For example:
The string method
Similarly, The string method
From now on, we will assume that you have Python installed on your system. You should now be able to write, save and run Python programs at ease. Now that you are a Python user, let us learn some more Python concepts. We have seen how to use operators, operands and expressions – these are the basic building blocks of any program. Next, we will see how to make use of these in our programs using statements. We have seen how to use the three control flow statements – if , while and for along with their associated break and continue statements. These are some of the most commonly used parts of Python and hence, becoming comfortable with them is essential.
What means fake code an information description of how the computer program should work quizlet?pseudocode. meaning fake code, is an informal description of how the computer program should work.
What is the process of transferring information from a legacy system to a new system multiple choice question?System migration is the process of transferring old IT systems to a newer hardware infrastructure or software platform to keep up with current technologies.
What refers to a unique set of keywords along with a special syntax for organizing program instructions?A programming language consists of a vocabulary containing a set of grammatical rules intended to convey instructions to a computer or computing device to perform specific tasks. Each programming language has an unique set of keywords along with a special syntax to organize the software's instructions.
What verifies that the units or pieces of code function correctly when integrated together?Unit testing is typically an automated test that verifies each unit—or, isolated piece of coding—functions as the developer intended. Unit tests are conducted individually, often referred to as “test cases” consisting of segments of code that work together to perform a specific function.
|