junit

Best practices for Android Unit Testing?

家住魔仙堡 提交于 2020-12-28 06:51:28
问题 I am developing a mobile android app. What are the most common libraries/frameworks used for Android unit testing? I feel that most of the business logic, database testing, Web services testing can all be done using JUnit. However, what's the best approach for testing UI, the UI workflow, etc? For example, how can we test if the Android app launches a web browser successfully? Or how can we confirm if buttons, certain things are pressed successfully? Or if images are loaded successfully? 回答1:

Best practices for Android Unit Testing?

你。 提交于 2020-12-28 06:50:28
问题 I am developing a mobile android app. What are the most common libraries/frameworks used for Android unit testing? I feel that most of the business logic, database testing, Web services testing can all be done using JUnit. However, what's the best approach for testing UI, the UI workflow, etc? For example, how can we test if the Android app launches a web browser successfully? Or how can we confirm if buttons, certain things are pressed successfully? Or if images are loaded successfully? 回答1:

LeetCode

◇◆丶佛笑我妖孽 提交于 2020-12-27 17:24:23
Topic Hash Table Math Description https://leetcode.com/problems/count-primes/ Count the number of prime numbers less than a non-negative number, n. Example 1 : Input: n = 10 Output: 4 Explanation: There are 4 prime numbers less than 10, they are 2, 3, 5, 7. Example 2 : Input: n = 0 Output: 0 Example 3 : Input: n = 1 Output: 0 Constraints : 0 <= n <= 5 * 10⁶ Analysis 埃拉托色尼筛选法(the Sieve of Eratosthenes)简称埃氏筛法,是古希腊数学家埃拉托色尼(Eratosthenes 274B.C.~194B.C.)提出的一种筛选法。 是针对自然数列中的自然数而实施的,用于求一定范围内的质数,它的容斥原理之完备性条件是p=H~。 埃拉托色尼筛选法_百度百科 Submission public class CountPrimes { public int countPrimes(int n) {

Spring Data套装基础之MongoDB

拈花ヽ惹草 提交于 2020-12-26 11:31:53
1. 简介 Spring Data MongoDB属于Spring Data套装中的一个工具,提供了对MongoDB数据库操作的封装。 相对于直接使用MongoDB的驱动,Spring Data MongoDB可能更有优势,不管是简单还是复杂的操作。 对于简单的操作Spring Data MongoDB甚至基本都不用写什么代码。 对于复杂的操作Spring Data MongoDB在抽象层做得更好,更方便维护。 2. 实体类 import org.springframework.data.annotation.Id; import org.springframework.data.mongodb.core.mapping.DBRef; import org.springframework.data.mongodb.core.mapping.Document; import java.util.List; @Document(collection = "student") public class Student { @Id private String id; private String name; private Integer age; @DBRef private List<Teacher> teachers; public String getId() { return

十二个Java程序员必须掌握的Java开发框架

两盒软妹~` 提交于 2020-12-26 06:25:24
  十二个Java程序员必须掌握的Java开发框架有哪些?Java 开发应用很广泛,所以程序员就业行业和方向也很多,随着互联的发展,人工智能、大数据、区块链,很多Java 程序员选择Java Web/后端开发。然而程序员之前的区别还是很大的,如果想要拿高薪,作为一个程序员需要不断学习。   十二个必须掌握Java开发框架如下:   Java开发框架一、Spring   毫无疑问,Spring 框架现在是 Java 后端框架家族里面最强大的一个,其拥有 IOC 和 AOP 两大利器,大大简化了软件开发复杂性。并且,Spring 现在能与所有主流开发框架集成,可谓是一个万能框架,Spring 让 JAVA 开发变得更多简单。   Java开发框架二、Spring MVC   Spring MVC 是一个 MVC 开源框架,用来代替 Struts。它是 Spring 项目里面的一个重要组成部分,能与 Spring IOC 容器紧密结合,以及拥有松耦合、方便配置、代码分离等特点,让 JAVA 程序员开发 WEB 项目变得更加容易。   Java开发框架三、Spring Boot   Spring Boot 是 Spring 开源组织下的一个子项目,也是 Spring 组件一站式解决方案,主要是为了简化使用 Spring 框架的难度,简省繁重的配置。   Spring

LeetCode

試著忘記壹切 提交于 2020-12-23 19:44:02
Topic Array Hash Table Description https://leetcode.com/problems/two-sum/ Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have exactly one solution , and you may not use the same element twice. You can return the answer in any order. Example 1 : Input: nums = [2,7,11,15], target = 9 Output: [0,1] Output: Because nums[0] + nums[1] == 9, we return [0, 1]. Example 2 : Input: nums = [3,2,4], target = 6 Output: [1,2] Example 3 : Input: nums = [3,3], target = 6 Output: [0,1] Constraints: 2

junit单元测试不通过报documentationPluginsBootstrapper相关异常

别来无恙 提交于 2020-12-23 18:23:11
junit单元测试不通过报documentationPluginsBootstrapper相关异常 参考文章: (1)junit单元测试不通过报documentationPluginsBootstrapper相关异常 (2)https://www.cnblogs.com/li150dan/p/11132031.html 备忘一下。 来源: oschina 链接: https://my.oschina.net/u/4432649/blog/4834518

LeetCode

六眼飞鱼酱① 提交于 2020-12-23 12:41:45
Topic Bit Manipulation Description https://leetcode.com/problems/number-of-1-bits/ Write a function that takes an unsigned integer and returns the number of '1' bits it has (also known as the Hamming weight). Note: Note that in some languages such as Java, there is no unsigned integer type. In this case, the input will be given as a signed integer type. It should not affect your implementation, as the integer's internal binary representation is the same, whether it is signed or unsigned. In Java, the compiler represents the signed integers using 2's complement notation. Therefore, in Example 3

LeetCode

你。 提交于 2020-12-20 00:17:58
Topic Array Two Pointers Binary Search Description https://leetcode.com/problems/find-the-duplicate-number/ Given an array of integers nums containing n + 1 integers where each integer is in the range [1, n] inclusive. There is only one duplicate number in nums, return this duplicate number. Follow-ups : How can we prove that at least one duplicate number must exist in nums ? Can you solve the problem without modifying the array nums ? Can you solve the problem using only constant, O(1) extra space? Can you solve the problem with runtime complexity less than O(n²) ? Example 1 : Input: nums =

软件测试基础知识

烈酒焚心 提交于 2020-12-19 16:48:49
一、软件测试概念 什么是软件测试?百度百科上,软件测试的经典定义是:在规定的条件下对程序进行操作,以发现程序错误,衡量软件质量,并对其是否能满足设计要求进行评估的过程。 其实说直白一点,就是找bug。 二、软件测试目的 软件测试的目的,就是基于概念而言的。其目的大概分为以下几种: 1.发现软件的缺陷 2.提高软件质量 3.软件开发,测试过程改进 4.评估软件质量 5.降低公司对软件的维护成本 6.降低软件发布后,对公司负面影响的风险 三、软件测试模型 常见的 软件测试模型 包括V模型、W模型、H模型、X模型和前置模型。这里暂且介绍常用的V模型及W模型。 1.V模型 V模型是最具有代表意义的测试模型。V模型是软件开发瀑布模型的变种,它反映了测试活动与分析和设计的关系 。 用户需求 验收测试 需求分析和系统设计 确认测试和系统测试 概要设计 集成测试 详细设计 单元测试 编码 1)从左到右,描述了基本的开发过程和测试行为,非常明确地标明了测试过程中存在的不同级别,并且清楚地描述了这些测试阶段和开发过程期间各阶段的对应关系 。 2)左边依次下降的是开发过程各阶段,与此相对应的是右边依次上升的部分,即各测试过程的各个阶段。 优点 :V模型的价值在于它非常明确地标明了测试过程中存在的不同级别,并且清楚地描述了这些测试阶段和开发过程期间各阶段的对应关系。 缺点 :仅仅把 测试过程 作为在