Skip to content

Latest commit

 

History

History
230 lines (211 loc) · 14.7 KB

File metadata and controls

230 lines (211 loc) · 14.7 KB

BooleanOperatorsTest

Test -> should_perform_logical_boolean_operations

  • Q1: What is the knowledge point of the test? Where is the official document to the knowledge point?
  • The knowledge point of the test is to learn the behavior of booleans and bitwise and how to determine its use.
  • The official document of this knowledge point is https://www.edureka.co/blog/java-tutorial/.
  • Q2: Why the test failed at first?
  • The test failed at first because the expected result was not assigned.
  • Thus, the expected result and the actual result are not the same.
  • Q3: Why you corrected the test that way?
  • I corrected it this way since what is used are logical operations, thus I assumed that the result would also be booolean.
  • Q4: Do you have further questions on this knowledge point?
  • No.

Test -> should_perform_logical_boolean_operations

  • Q1 What is the knowledge point of the test? Where is the offical document to the knowledge point?
  • The knowledge point of the test is to learn the behavior of bitwise operations and and determine use it.
  • The official document of this knowledge point is https://docs.oracle.com/javase/tutorial/java/nutsandbolts/op3.html.
  • Q2: Why the test failed at first?
  • The test failed at first because the expected result was assigned as 0.
  • Thus, the expected result and the actual result are not the same.
  • Q3: Why you corrected the test that way?
  • I corrected the test this way because I saw the bitwise operator "&" and assumed that they were needed to be joined using AND.
  • Q4: Do you have further questions on this knowledge point?
  • No.

Test -> should_perform_logical_boolean_operations

  • Q1 What is the knowledge point of the test? Where is the offical document to the knowledge point?
  • The knowledge point of the test is to learn the behavior of bitwise operations and and determine use it.
  • The official document of this knowledge point is https://docs.oracle.com/javase/tutorial/java/nutsandbolts/op3.html.
  • Q2: Why the test failed at first?
  • The test failed at first because the expected result was assigned as 0.
  • Thus, the expected result and the actual result are not the same.
  • Q3: Why you corrected the test that way?
  • I corrected the test this way because I saw the bitwise operator "|" and assumed that they were needed to be joined using OR.
  • Q4: Do you have further questions on this knowledge point?
  • No.

Test -> should_perform_logical_boolean_operations

  • Q1 What is the knowledge point of the test? Where is the offical document to the knowledge point?
  • The knowledge point of the test is how to negate hex. The offical document of the knowledge point is http://www.technosoft.ro/KB/index.php?/article/AA-15440/0/The-negative-numbers-representation-in-hex.html.
  • Q2: Why the test failed at first?
  • The test failed at first because the expected result was assigned as 0. Thus, the expected result and the actual result are not the same.
  • Q3: Why you corrected the test that way?
  • I corrected the test this way because I saw the bitwise operator "~".
  • Q4: Do you have further questions on this knowledge point?
  • No.

CharTypeTest

Test -> should_describe_escaped_chars

  • Q1: What is the knowledge point of the test? Where is the official document to the knowledge point?
  • The knowledge point of the test is to learn the behavior of escape characters and how to determine its use.
  • The official document of this knowledge point is https://www.freeformatter.com/java-dotnet-escape.html.
  • Q2: Why the test failed at first?
  • The test failed at first because the expected result was not assigned.
  • Thus, the expected result and the actual result are not the same.
  • Q3: Why you corrected the test that way?
  • I corrected it this way since what is actual are their values, I just assigned the characters.
  • Q4: Do you have further questions on this knowledge point?
  • No.

FloatingTypeTest

Test -> should_not_get_rounded_result_if_convert_floating_number_to_integer

  • Q1: What is the knowledge point of the test? Where is the official document to the knowledge point?
  • The knowledge point of the test is to learn the behavior of Floating Type and how to determine its use.
  • The official document of this knowledge point is https://study.com/academy/lesson/java-floating-point-numbers.html.
  • Q2: Why the test failed at first?
  • The test failed at first because the expected result was Integer.MAX_VALUE.
  • Thus, the expected result and the actual result are not the same.
  • Q3: Why you corrected the test that way?
  • I corrected it this way because the float was casted to integer, so I just assumed that what is expected was the integer value.
  • Q4: Do you have further questions on this knowledge point?
  • No.

Test -> should_judge_special_double_cases

  • Q1 What is the knowledge point of the test? Where is the offical document to the knowledge point?
  • The knowledge point of the test is to learn how to determine if Float is infinite or NAN and how to use it.
  • The official document of this knowledge point is http://www.java2s.com/Tutorials/Java/Data_Type_How_to/float/Check_if_a_Java_Float_is_Infinite_or_Not_a_Number_NAN_.htm.
  • Q2: Why the test failed at first?
  • The test failed at first because the methods did not return any value.
  • Q3: Why you corrected the test that way?
  • I corrected the test this way because I have read that there is a function in the object Double that determines if the number is infinite or nan.
  • Q4: Do you have further questions on this knowledge point?
  • No.

Test -> should_not_round_number_when_convert_to_integer

  • Q1: What is the knowledge point of the test? Where is the official document to the knowledge point?
  • The knowledge point of the test is to learn the behavior of Floating Type and how to determine its use.
  • The official document of this knowledge point is https://study.com/academy/lesson/java-floating-point-numbers.html.
  • Q2: Why the test failed at first?
  • The test failed at first because the expected result was Integer.MAX_VALUE.
  • Thus, the expected result and the actual result are not the same.
  • Q3: Why you corrected the test that way?
  • I corrected it this way because the float was casted to integer, so I just assumed that what is expected was the integer value.
  • Q4: Do you have further questions on this knowledge point?
  • No.

Test -> should_round_number

  • Q1 What is the knowledge point of the test? Where is the offical document to the knowledge point?
  • The knowledge point of the test is how to use Math object. The offical document of the knowledge point is https://www.tutorialspoint.com/java/lang/java_lang_math.htm
  • Q2: Why the test failed at first?
  • The test failed at first because the expected result and the actual result are not the same.
  • Q3: Why you corrected the test that way?
  • I corrected the test this way because there is a function in Math object that can round up or down numbers.
  • Q4: Do you have further questions on this knowledge point?
  • No.

IntegerTypeTest

Test -> should_get_range_of_primitive_int_type

  • Q1: What is the knowledge point of the test? Where is the official document to the knowledge point?
  • The knowledge point of the test is to learn the behavior of Integer and how to determine its use.
  • The official document of this knowledge point is https://www.tutorialspoint.com/java/lang/java_lang_integer.htm.
  • Q2: Why the test failed at first?
  • The test failed at first because the expected result were assigned with the wrong value.
  • Thus, the expected result and the actual result are not the same.
  • Q3: Why you corrected the test that way?
  • I corrected it this way because according to the document there is a constant that has the same value as actual.
  • Q4: Do you have further questions on this knowledge point?
  • No.

Test -> should_get_range_of_primitive_short_type

  • Q1 What is the knowledge point of the test? Where is the offical document to the knowledge point?
  • The knowledge point of the test is to learn the behavior of Short and how to determine its use.
  • The official document of this knowledge point is https://www.tutorialspoint.com/java/lang/java_lang_short.htm.
  • Q2: Why the test failed at first?
  • The test failed at first because the expected result were assigned with the wrong value.
  • Thus, the expected result and the actual result are not the same.
  • Q3: Why you corrected the test that way?
  • I corrected it this way because according to the document there is a constant that has the same value as actual.
  • Q4: Do you have further questions on this knowledge point?
  • No.

Test -> should_not_round_number_when_convershould_get_range_of_primitive_long_typet_to_integer

  • Q1 What is the knowledge point of the test? Where is the offical document to the knowledge point?
  • The knowledge point of the test is to learn the behavior of Long and how to determine its use.
  • The official document of this knowledge point is https://www.tutorialspoint.com/java/lang/java_lang_long.htm.
  • Q2: Why the test failed at first?
  • The test failed at first because the expected result were assigned with the wrong value.
  • Thus, the expected result and the actual result are not the same.
  • Q3: Why you corrected the test that way?
  • I corrected it this way because according to the document there is a constant that has the same value as actual.
  • Q4: Do you have further questions on this knowledge point?
  • No.

Test -> should_get_range_of_primitive_byte_type

  • Q1 What is the knowledge point of the test? Where is the offical document to the knowledge point?
  • The knowledge point of the test is to learn the behavior of Byte and how to determine its use.
  • The official document of this knowledge point is https://www.tutorialspoint.com/java/lang/java_lang_byte.htm.
  • Q2: Why the test failed at first?
  • The test failed at first because the expected result were assigned with the wrong value.
  • Thus, the expected result and the actual result are not the same.
  • Q3: Why you corrected the test that way?
  • I corrected it this way because according to the document there is a constant that has the same value as actual.
  • Q4: Do you have further questions on this knowledge point?
  • No.

Test -> should_overflow_silently

  • Q1 What is the knowledge point of the test? Where is the offical document to the knowledge point?
  • The knowledge point of the test is to learn the behavior of Integer when it overflows and how to determine its use.
  • The official document of this knowledge point is https://dzone.com/articles/overflow-and-underflow-data.
  • Q2: Why the test failed at first?
  • The test failed at first because the expected result were assigned with the wrong value.
  • Thus, the expected result and the actual result are not the same.
  • Q3: Why you corrected the test that way?
  • I corrected it this way because according to the document that when the 1 is added to the max value, it will roll over which will result to minimum value.
  • Q4: Do you have further questions on this knowledge point?
  • No.

Test -> should_underflow_silently

  • Q1 What is the knowledge point of the test? Where is the offical document to the knowledge point?
  • The knowledge point of the test is to learn the behavior of Integer when it underflows and how to determine its use.
  • The official document of this knowledge point is https://dzone.com/articles/overflow-and-underflow-data.
  • Q2: Why the test failed at first?
  • The test failed at first because the expected result were assigned with the wrong value.
  • Thus, the expected result and the actual result are not the same.
  • Q3: Why you corrected the test that way?
  • I corrected it this way because according to the document that when the 1 is subtracted to the min value, it will roll over which will result to max value.
  • Q4: Do you have further questions on this knowledge point?
  • No.

Test -> should_throw_exception_when_overflow

Test -> just_prevent_lazy_implementation

  • Q1 What is the knowledge point of the test? Where is the offical document to the knowledge point?
  • The knowledge point of the test is to learn the behavior of Math object when it overflows and how to determine its use.
  • The official document of this knowledge point is https://howtodoinjava.com/java8/java-8-exact-airthmetic-operations-supported-in-math-class/.
  • Q2: Why the test failed at first?
  • The test failed at first because there is no exception thrown.
  • Q3: Why you corrected the test that way?
  • I corrected it this way because according to the document addExact() throws an exception when it overflows.
  • Q4: Do you have further questions on this knowledge point?
  • No.

Test -> should_take_care_of_number_type_when_doing_calculation

  • Q1 What is the knowledge point of the test? Where is the offical document to the knowledge point?
  • The knowledge point of the test is to learn the behavior of data types when it computing.
  • The official document of this knowledge point is https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html.
  • Q2: Why the test failed at first?
  • The test failed at first because the expected result were assigned with the wrong value.
  • Thus, the expected result and the actual result are not the same.
  • Q3: Why you corrected the test that way?
  • I corrected it this way because the numbers in the equation are integer, so it will be integer, but since it is assigned to a double, it will be converted after the computation.
  • Q4: Do you have further questions on this knowledge point?
  • No.

Test -> should_truncate_number_when_casting

  • Q1 What is the knowledge point of the test? Where is the offical document to the knowledge point?
  • The knowledge point of the test is to learn the behavior of increment operators, specifically (var)++.
  • The official document of this knowledge point is https://www.quora.com/What-is-the-difference-between-a++-and-++a-in-codingl.
  • Q2: Why the test failed at first?
  • The test failed at first because the expected result were assigned with the wrong value.
  • Thus, the expected result and the actual result are not the same.
  • Q3: Why you corrected the test that way?
  • I corrected it this way because the increment used is post-increment.
  • Q4: Do you have further questions on this knowledge point?
  • No.

Test -> should_increment_2

  • Q1 What is the knowledge point of the test? Where is the offical document to the knowledge point?
  • The knowledge point of the test is to learn the behavior of increment operators, specifically ++(var).
  • The official document of this knowledge point is https://www.quora.com/What-is-the-difference-between-a++-and-++a-in-codingl.
  • Q2: Why the test failed at first?
  • The test failed at first because the expected result were assigned with the wrong value.
  • Thus, the expected result and the actual result are not the same.
  • Q3: Why you corrected the test that way?
  • I corrected it this way because the increment used is pre-increment.
  • Q4: Do you have further questions on this knowledge point?
  • No.