testing pyramid System Tests Integration Tests Unit Tests
## What is a Unit Test?
## What is a Unit Test 0 码力 |
79 页 |
25.86 MB
| 1 年前 3 ## Scientific Unit Testing
Dave Steffen, Ph.D.
Software Lead
dsteffen@scitec.com
— in Physics
which is relevant
SCiTEC
Science & Technology Innovation
www.scitec.com
If I have seen further bad tests are almost always better than no tests!
## Unit Testing OO Code
## Test using only the public interface
("Black Box" testing)
• Forces better design ("design for testability") coupling to implementation
• Unit tests are also examples and documentation
## Object Oriented testing
## Let's unit test this class
1 // Cup.h
// creates an empty cup
bool IsEmpty();
bool Fill(); 0 码力 |
45 页 |
1.91 MB
| 1 年前 3 ## +21
## Testing Compile-time Constructs Within a Runtime Unit Testing Framework
## I GOR BOGOSLAVSKYI
20
21
October 24-29
## We use C++ (14) for safety-critical applications that we deliver to our ments/4/8/e/9/48e97f15addfced313a9cb60758e45d2/p2_1.jpg)
Errors have a high cost, so rigorous testing is a must
We use increasingly more compile-time polymorphism and checks
Question: how to test if get_half_of(T smth) {
return smth / T{2};
}
## Write a rigorous testing suite
#include
TEST(TestMyApi, Halving) {
EXPECT_FLOAT_EQ(21.0F, get_half_of(42 0 码力 |
50 页 |
1.37 MB
| 1 年前 3 Testing
Version 5.3.36-SNAPSHOT
## Table of Contents
1. Introduction to Spring Testing 2
2. Unit Testing 3
2.1. Mock Objects 3
2.1.1. Environment 3
2.1.2. JNDI 3
2.1.3. Servlet API 4
2.1 2. Unit Testing Support Classes 4
2.2.1. General Testing Utilities 4
2.2.2. Spring MVC Testing Utilities 5
3. Integration Testing 6
3.1. Overview 6
3.2. Goals of Integration Testing 6
3.2.1
3.2.3. Transaction Management 8
3.2.4. Support Classes for Integration Testing 8
3.3. JDBC Testing Support 8
3.4. Annotations 9
3.4.1. Spring Testing Annotations 9
@BootstrapWith 10
@ContextConfiguration 0 码力 |
193 页 |
2.53 MB
| 2 年前 3 ## +24
## Back To Basics Debugging and Testing
## GREG LAW & MIKE SHAH
### Writing software is really hard. If it’s not tested, it doesn’t work
Or at least it will soon stop working.
## WHAT'S 4/p5_1.jpg)
BUT WHEN I DO,
DO IT IN
PRODUCTION
Software development done right is basically testing and debugging.
## GOOD TESTS ARE
• Independent
• Repeatable
Fast
## DIFFERENT TESTS — ALL ARE generally shallow / easy-to-fix.
Tests run fast – tight feedback loop.
But...
Assumptions!
## UNIT TESTING FRAMEWORKS
Google Gest
Catch2
Boost.Test
• CppUTest
• doctest

Testing Compile-time Constructs in a Runtime Unit Testing ...
YouTube · CppCon Feb 15, 2022
It's A Bug Hu
Armor Plate You
2023
## Unit Testing is a Big Topic
• Jody Hagins (today): The Most Important Design Guideline is Testability
• Greg Law and Mike Shah (tomorrow): Back To Basics, Debugging and Testing
• Chip Hogg (Wednesday) 0 码力 |
109 页 |
4.13 MB
| 1 年前 3 ## DBeaver
CLICKHOUSE И ДВЕАVER, ИЛИ КОМУ НУЖЕН JDBC?
dbeaver.com
## 1

## DBeaver
Универсальный
интерфейс
для работы ЮДС-ДРАЙВЕРЕ В ДВУХ СЛОВАХ
√ JDBC-драйвер для Clickhouse есть и даже не один
Х Никто не идеален, и JDBC-драйвер тоже
## СЛОЖНОСТИ
## !
1. Соответствие спецификации JDBC
2. Новая версия драйвера не не всегда работает
3. Существование разных JDBC-драйверов
4. Нехватка аналитических функций
## COOTBETCTBIE JDBC API
## ВОПРОСЫ
• Нестандартно возвращаются значения массивов
• Метаданные о числовых 0 码力 |
9 页 |
2.16 MB
| 2 年前 3 ## 2 Sharding- JDBC入门使用
### 2.1 不使用 Spring
## 引入Maven依赖
org.apache.shardingsphere
sharding-jdbc-core
${sharding-sphere.version} version}
## 基于Java编码的规则配置
Sharding- JDBC的分库分表通过规则配置描述,以下例子是根据user_id取模分库,且根据order_id取模分表的两库两表的配置。
// 配置真实数据源
Map dataSourceMap = new HashMap<>();
// dataSource1 = new BasicDataSource();
dataSource1.setDriverClassName("com.mysql.jdbc.Driver");
dataSource1.setUrl("jdbc:mysql://localhost:3306/ds0");
dataSource1.setUsername("root");
dataSource1 0 码力 |
12 页 |
325.38 KB
| 2 年前 3
|