Reading-Notes

View the Project on GitHub MohammadAl-khatib/Reading-Notes

Game of Greed 1

How to use Random Module

First modules are files that contain definitions and statements that can be imported and used in other files, in this article we will be introduced to a well known module called random.

Random module comes with a set of handy functions used to generate random values or manipulate arrays in a random way, here is alist of some functions and their use:

Function description
Randint generates a random number between the entered arguments
Random generates a random number between 0 and 1
Choice generates a random value from a set of values (like lists)
Shuffle orders an array randomly in place
Randrange generates a random number from a given range and a step

What is Risk Analysis

The identification of any unwanted incident is called risk analysis, it serves as a key part in mitigating the risks, taking software industry in regard, these are the common risks that might be encountered:

  1. Use of new hardware
  2. Use of new technology
  3. Use of new automation tool
  4. The sequence of code
  5. Availability of test resources for the application

One aspect to be familiar with is the risk magnitude indicators, these are:

The steps of risk analysis are:

  1. Risk Identification
  2. Risk Assessment: the most important and it goes as follows:     - Searching the risk     - Defining the impact of the risk     - Measuring the risk (using indicators)

see original article for more information

Test Coverage

The percentage of tests passed a code may have might be tricky some times, and it does not necessarily reflect a perfect code. Instead of focusing on the number of tests passed, a more focus on the quality of tests passed must be taken into consideration. Giving a great focus on passing tests may result in writing tests that can easily be passed, make sure that your tests covers the edge cases of the problem your code solves, the different use cases of the code, and the different inputs it may deal with.

Big O Notation

4 rules to take when calculating the Big O:

  1. Different steps get odded (Big O results from adding Big O of each step alone)
  2. Drop constants
  3. Different inputs have different variables
  4. Drop non dominant terms.