Building a Test Automation Framework is easy - there are so many resources / guides / blogs / etc. available to help you get started and help solve the issues you get along the journey.
However, building a "good" Test Automation Framework is not very easy. There are a lot of principles and practices you need to use, in the right context, with a good set of skills required to make the Test Automation Framework maintainable, scalable and reusable.
Design Patterns play a big role in helping achieve this goal of building a good and robust framework.
In this talk, we will talk about, and see examples of various types of patterns you can use for:
Build your Test Automation Framework
Test Data Management
Locators / IDs (for finding / interacting with elements in the browser / app)
Using these patterns you will be able to build a good framework, that will help keep your tests running fast, and reliably in your CI / CD setup!
unassert - encourage reliable programming by writing assertions in productionTakuto Wada
unassert - Encourage Design by Contract (DbC) by writing assertions in production code, and compiling them away from release.
Takuto Wada
2015/11/07 @nodefest Tokkyo 2015
【DLゼミ】XFeat: Accelerated Features for Lightweight Image Matchingharmonylab
公開URL:https://arxiv.org/pdf/2404.19174
出典:Guilherme Potje, Felipe Cadar, Andre Araujo, Renato Martins, Erickson R. ascimento: XFeat: Accelerated Features for Lightweight Image Matching, Proceedings of the 2024 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) (2023)
概要:リソース効率に優れた特徴点マッチングのための軽量なアーキテクチャ「XFeat(Accelerated Features)」を提案します。手法は、局所的な特徴点の検出、抽出、マッチングのための畳み込みニューラルネットワークの基本的な設計を再検討します。特に、リソースが限られたデバイス向けに迅速かつ堅牢なアルゴリズムが必要とされるため、解像度を可能な限り高く保ちながら、ネットワークのチャネル数を制限します。さらに、スパース下でのマッチングを選択できる設計となっており、ナビゲーションやARなどのアプリケーションに適しています。XFeatは、高速かつ同等以上の精度を実現し、一般的なラップトップのCPU上でリアルタイムで動作します。
セル生産方式におけるロボットの活用には様々な問題があるが,その一つとして 3 体以上の物体の組み立てが挙げられる.一般に,複数物体を同時に組み立てる際は,対象の部品をそれぞれロボットアームまたは治具でそれぞれ独立に保持することで組み立てを遂行すると考えられる.ただし,この方法ではロボットアームや治具を部品数と同じ数だけ必要とし,部品数が多いほどコスト面や設置スペースの関係で無駄が多くなる.この課題に対して音𣷓らは組み立て対象物に働く接触力等の解析により,治具等で固定されていない対象物が組み立て作業中に運動しにくい状態となる条件を求めた.すなわち,環境中の非把持対象物のロバスト性を考慮して,組み立て作業条件を検討している.本研究ではこの方策に基づいて,複数物体の組み立て作業を単腕マニピュレータで実行することを目的とする.このとき,対象物のロバスト性を考慮することで,仮組状態の複数物体を同時に扱う手法を提案する.作業対象としてパイプジョイントの組み立てを挙げ,簡易な道具を用いることで単腕マニピュレータで複数物体を同時に把持できることを示す.さらに,作業成功率の向上のために RGB-D カメラを用いた物体の位置検出に基づくロボット制御及び動作計画を実装する.
This paper discusses assembly operations using a single manipulator and a parallel gripper to simultaneously
grasp multiple objects and hold the group of temporarily assembled objects. Multiple robots and jigs generally operate
assembly tasks by constraining the target objects mechanically or geometrically to prevent them from moving. It is
necessary to analyze the physical interaction between the objects for such constraints to achieve the tasks with a single
gripper. In this paper, we focus on assembling pipe joints as an example and discuss constraining the motion of the
objects. Our demonstration shows that a simple tool can facilitate holding multiple objects with a single gripper.
3. 前回のまとめ
設定可能?
Dummy コンパイラを満足させるためだけに存在 ×
Stub テストから設定された値を SUT に返すために使う。 ○
Spy SUT から値を受けとるために使う。SUT とのやりとりを覚え ○
ていて、テストは後で spy から聞き出す。
Mock 間接的入力/出力に使え、SUT とのやりとりを厳格にも寛容に ○
もすることができる。予想外のやりとりならすぐ失敗させるこ
ともできる
Fake テスト用に単純化された、 DOC の別実装。実際には DB に接 ×
続に行かず、特定の値を返す Dao とか。
4. Providing the Test Double
●
2 approaches
●
Hand-Built Test Double
– Hard-Coded Test Double
– ちょっとがんばれば configurable になる
●
Dynamically Generated Test Double
– 基本的に Configurable Test Double
– jMock ファミリーが代表的 (←ちょっと情報が古い)
– EasyMock は少し毛色が違う
5. public void testDisplayCurrentTime_AtMidnight_PS() throws Exception {
//Define and instantiate Test Stub
TimeProvider testStub = new PseudoTimeProvider() { //Anonymous inner stub
public Calendar getTime(String timeZone) {
Calendar myTime = new GregorianCalendar();
myTime.set(Calendar.MINUTE, 0);
myTime.set(Calendar.HOUR_OF_DAY, 0);
return myTime;
}
};
//Instantiate SUT
TimeDisplay sut = new TimeDisplay();
//Inject Test Stub into SUT
sut.setTimeProvider(testStub);
//Exercise SUT
String result = sut.getCurrentTimeAsHtmlFragment();
//Verify direct output
String expectedTimeString = "<span class="tinyBoldText">Midnight</span>";
assertEquals("Midnight", expectedTimeString, result);
}
7. Pseudo-Objects
/**
* Base class for hand-coded Test Stubs and Mock Objects
*/
public class PseudoTimeProvider implements ComplexTimeProvider {
public Calendar getTime() throws TimeProviderEx {
throw new PseudoClassException();
}
public Calendar getTimeDifference(Calendar baseTime,
Calendar otherTime)
throws TimeProviderEx {
throw new PseudoClassException();
}
public Calendar getTime(String timeZone ) throws TimeProviderEx {
throw new PseudoClassException();
}
}
8. Configuring the Test Double
●
Test Stub, Mock Object は何を返すか、何を話し
かけられるかの設定行為が必要
●
Hard-Coded Test Double の場合は設計時(コーディン
グ時)に設定を行う
●
Configurable Test Double はランタイムにテストから
設定される
– Stub, Spy は何を返すかの設定が必要
– Mock は何を話しかけられるかの設定も加えて必要
●
どういう値を選ぶかは設計行為そのもの
●
テストの理解容易性
●
Double の再利用性
9. Configuring the Test Double(2)
●
Fake は SUT から使われるだけなのでランタイ
ムに設定される必要なし
●
Dummy は実行されないので設定の必要なし
●
Procedual Test Stub は Hard-Coded の代表
例
●