Stub (distributed computing)

In distributed computing, a stub is a program that acts as a temporary replacement for a remote service or object.[1] It allows the client application to access a service as if it were local, while hiding the details of the underlying network communication. This can simplify the development process, as the client application does not need to be aware of the complexities of distributed computing. Instead, it can rely on the stub to handle the remote communication, while providing a familiar interface for the developer to work with.

Application

The stub represents a remote object or service on a local system. It acts as a proxy for the remote service and allows the client program to make method calls on the remote object as if it were local. The process of generating stubs involves creating a client-side proxy object that provides the same interface as the remote service, but routes method calls to the actual remote object.

In distributed computing, a stub is a piece of code that converts parameters passed between the client and server during a remote procedure call (RPC). The main purpose of an RPC is to allow a local computer (client) to invoke procedures on a remote computer (server). Since the client and server have different address spaces, the parameters used in a function call must be converted. Otherwise, the parameter values would be unusable because pointers to parameters in one computer's memory would reference different data on the other computer. Also, the client and server can have different data representations, even for simple parameters like integers (e.g., big-endian versus little-endian). Stubs handle parameter conversion, making a remote procedure call look like a local function call to the remote computer.

Stub libraries are crucial in distributed computing, as they allow for local procedure calls to be made to remote objects or services. The client-side stub or proxy is responsible for converting the parameters used in a function call and deconverting the results returned by the server after executing the function, a process known as marshalling.[2] The stub libraries must be installed on both the client and server, with the server-side stub, or server skeleton, being responsible for deconverting the parameters passed by the client and converting the results after executing the function. In virtual testing environments, stubs are used to simulate distributed computing, allowing for more efficient and effective verification of software updates in variant-rich automotive systems.[4]

Steps to writing tests with stubs

To write tests with stubs, follow these steps:

  1. Identify the external components or services that the component being tested relies on to function correctly.[2] or manually create stubs versions of the dependencies that return predefined values or responses when called by the component under test.[3]
  2. Write test cases for the component, using the stubs instead of the actual dependencies.[2]
  3. Set up the test environment by initializing the component under test and its stubs.[4]
  4. Run the tests and analyze the results. If the tests fail, review the code and stubs to determine the cause of the issue.[2]
  5. Refactor the code and stubs as necessary to improve the quality of the tests and the component.[3]

It's crucial to use stubs only when needed, as they may introduce additional complexity and maintenance overhead. Furthermore, the stubs should accurately mimic the behavior of the actual dependencies to avoid introducing false positives or negatives in the tests.[2]

References

  1. ^ Coulouris, Dollimore, & Kindberg (2011). Distributed Systems: Concepts and Design. Pearson Education, Inc.{{cite book}}: CS1 maint: multiple names: authors list (link)
  2. ^ H. Guissouma, A. Lauber, A. Mkadem, E. Sax (2019). Virtual Test Environment for Efficient Verification of Software Updates for Variant-Rich Automotive Systems. IEEE.{{cite book}}: CS1 maint: multiple names: authors list (link)
  3. ^ Freeman, S., & Pryce, N. (2009). Growing Object-Oriented Software, Guided by Tests. Pearson Education, Inc.{{cite book}}: CS1 maint: multiple names: authors list (link)
  4. ^ Meszaros, G. (2003). xUnit Test Patterns: Refactoring Test Code. Pearson Education, Inc.

Read other articles:

GermaniaBerkas:Germania logo.svg IATA ICAO Kode panggil ST GMI GERMANIA Didirikan1978Berhenti beroperasi4 Februari 2019[1]Pusat operasi Bandar Udara Berlin Schönefeld Bandar Udara Berlin Tegel Bandar Udara Bremen Bandar Udara Dresden Bandar Udara Düsseldorf Bandar Udara Erfurt–Weimar Bandar Udara Friedrichshafen Bandar Udara Hamburg Bandar Udara München Bandar Udara Internasional Münster Osnabrück Bandar Udara Nürnberg Bandar Udara Internasional Pristina Bandar Udara Rostock�...

 

VedalamPoster perilisanSutradaraSivaProduserA. M. RathnamS. AishwaryaSkenarioSivaCeritaSivaAadhi NarayanaPemeran Ajith Kumar Shruti Hassan Lakshmi Menon Rahul Dev Kabir Duhan Singh Penata musikAnirudh RavichanderSinematograferVetriPenyuntingRubenPerusahaanproduksiSri Satya Sai MoviesDistributorSri Surya MoviesTanggal rilis 10 November 2015 (2015-11-10) (India) [1]Durasi154 menit[2]NegaraIndiaBahasaTamilPendapatankotor₹150 crore[3]Vedalam (bahasa Inggri...

 

Mosaik Tabut Perjanjian, sekitar 806 dari sebuah oratori di Germigny-des-Prés yang dibangun oleh Uskup Theodulf dari Orléans, yang diyakini merupakan pengarang dari karya tersebut. Libri Carolini (Buku-buku Charles), Opus Caroli regis contra synodum (Karya Raja Charles melawan Sinodo), yang juga disebut Buku-Buku Charlemagne atau singkatnya Carolines, adalah karya dalam empat buku yang terdiri atas komando Charlemagne, sekitar tahun 790 Libri Carolini tidak pernah mempromulgasikannya pada w...

Halaman ini berisi artikel tentang regulasi dan perjanjian dagang. Untuk senyawa kimia yang disingkat TTIP, lihat Titanium isopropoksida. Amerika Serikat (jingga) dan Uni Eropa (hijau) Kemitraan Perdagangan dan Investasi Transatlantik (Inggris: Transatlantic Trade and Investment Partnershipcode: en is deprecated ; TTIP) adalah rencana perjanjian perdagangan antara Uni Eropa dan Amerika Serikat yang bertujuan memajukan perdagangan dan pertumbuhan ekonomi antarnegara. Pemerintah Amerika Serikat...

 

Tenebrio molitor Tenebrio molitor Le « ténébrion meunier » - Muséum de Toulouse.Classification Règne Animalia Embranchement Arthropoda Classe Insecta Ordre Coleoptera Famille Tenebrionidae Sous-famille Tenebrioninae Genre Tenebrio EspèceTenebrio molitorLinnaeus, 1758 Le ténébrion meunier (Tenebrio molitor) est une espèce d'insectes coléoptères qui affectionne notamment les farines de céréales, de la famille des ténébrionidés. C'est un insecte cosmopolite, probableme...

 

Waffle cookie with caramel syrup filling This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Stroopwafel – news · newspapers · books · scholar · JSTOR (March 2022) (Learn how and when to remove this template message) StroopwafelA plate of stroopwafelsAlternative namesSyrup waffle, treacle waffle, caramel waffle&...

Флаг гордости бисексуалов Бисексуальность      Сексуальные ориентации Бисексуальность Пансексуальность Полисексуальность Моносексуальность Сексуальные идентичности Би-любопытство Гетерогибкость и гомогибкость Сексуальная текучесть Исследования Шк...

 

Державний комітет телебачення і радіомовлення України (Держкомтелерадіо) Приміщення комітетуЗагальна інформаціяКраїна  УкраїнаДата створення 2003Керівне відомство Кабінет Міністрів УкраїниРічний бюджет 1 964 898 500 ₴[1]Голова Олег НаливайкоПідвідомчі ор...

 

Kejuaraan Dunia Dayung 2017LokasiNathan Benderson Park,Sarasota, Amerika SerikatTanggal24 September – 1 Oktober 2017← 20162018 → Kejuaraan Dunia Dayung 2017 adalah edisi ke-47 dari penyelenggaraan turnamen dayung internasional, Kejuaraan Dunia Dayung. Edisi ini diselenggarakan di Nathan Benderson Park, Sarasota, Amerika Serikat, sejak tanggal 24 September hingga 1 Oktober 2017. Edisi ini menyelenggarakan 21 nomor lomba utama dan juga 5 nomor lomba adaptif, yang ditujuk...

Castelnuovo Bormida komune di Italia Tempat Negara berdaulatItaliaDaerah di ItaliaPiemonteProvinsi di ItaliaProvinsi Alessandria NegaraItalia Ibu kotaCastelnuovo Bormida PendudukTotal626  (2023 )GeografiLuas wilayah13,11 km² [convert: unit tak dikenal]Ketinggian123 m Berbatasan denganRivalta Bormida Sezzadio Cassine SejarahHari liburpatronal festival Santo pelindungCyricus and Julitta Informasi tambahanKode pos15017 Zona waktuUTC+1 UTC+2 Kode telepon0144 ID ISTAT006052 Kode kadaste...

 

2016 police killing in Falcon Heights Killing of Philando CastileMinnesota Bureau of Criminal Apprehension investigators process the sceneDateJuly 6, 2016; 7 years ago (2016-07-06)LocationLarpenteur Avenue and Fry Street, Falcon Heights, Minnesota, U.S.Coordinates44°59′30″N 93°10′17″W / 44.99167°N 93.17139°W / 44.99167; -93.17139TypeHomicide by shootingFilmed byDiamond ReynoldsOutcomeYanez fired in 2017DeathsPhilando CastileArrestsJeronimo...

 

Ice hockey museum in Toronto, Canada Hockey Hall of FameFrench: Temple de la renommée du hockeyThe Hall's present location on Yonge Street since 1992Established1943Location30 Yonge StreetToronto, OntarioM5E 1X8Coordinates43°38′49″N 79°22′38″W / 43.6470°N 79.3773°W / 43.6470; -79.3773FounderJames T. SutherlandChairpersonLanny McDonald[1]Websitewww.hhof.comInductees299 players115 builders16 on-ice officials430 total The Hockey Hall of Fame (French: T...

Village and civil parish in Nottinghamshire, England Village and civil parish in EnglandRadcliffe-on-TrentVillage and civil parishMain Road, Radcliffe on TrentParish mapRadcliffe-on-TrentLocation within NottinghamshireArea3.08 sq mi (8.0 km2)Population8,144 (2021 Census)• Density2,644/sq mi (1,021/km2)OS grid referenceSK 64497 39312• London105 mi (169 km) SSEDistrictRushcliffeShire countyNottinghamshireRegionEast MidlandsCou...

 

Vegar LandroNazionalità Norvegia Altezza182 cm Peso76 kg Calcio RuoloDifensore Termine carriera2017 CarrieraSquadre di club1 2002-2003 Brann2 (0)2004-2005 Kongsvinger18 (0)2005-2006 Løv-Ham34 (0)2007-2017 Bryne283 (13) Nazionale 1999 Norvegia U-162 (0)2000 Norvegia U-175 (1)2001 Norvegia U-182 (0)2002 Norvegia U-195 (0)2004 Norvegia U-211 (0) 1 I due numeri indicano le presenze e le reti segnate, per le sole partite di campionato.Il simbolo → indica un trasferimen...

 

Untuk kegunaan lain, lihat model. Model pada dasarnya dibuat dari adonan yang sama dengan pempek kapal selam. Bedanya, model diisi dengan tahu dan digoreng sebelum disaji. Pada waktu dihidangkan, model di campur dengan kuah model yang terbuat dari kaldu udang. Selain dicampur dengan bihun, biasanya dicampur dengan timun dan ebi. Jenis-jenis model Jenis-jenis model ini terdiri dari 2 macam, yaitu model ikan dan model gendum. Model ikan dibuat dengan bahan yang hampir sama dengan pempek. Sedang...

USS LST-652 pada Desember 1944 Sejarah Amerika Serikat Nama LST-652Pembangun Chicago Bridge and Iron Company, SenecaPasang lunas 24 Juli 1944Diluncurkan 19 Oktober 1944Mulai berlayar 1 Januari 1945Dipensiunkan 5 Maret 1946 Asal nama LST(H)-652 Q086 T-LST-652 Dicoret 1 Mei 1961Identifikasi Tanda panggil: NFIR[1] Nasib Ditransfer ke Indonesia, 1961 Indonesia Nama Teluk KauAsal nama Teluk KaoDiperoleh 1961Pelabuhan daftar Tanjung Priok, JakartaIdentifikasi Nomor lambung: 504Nasib Tengge...

 

RavioliJenisPastaTempat asalItaliaDaerahItalia Tengah, Italia UtaraBahan utamaTerigu, telur, air, isiSunting kotak info • L • BBantuan penggunaan templat ini Buku resep: Ravioli  Media: Ravioli Ravioli adalah jenis pasta yang terdiri dari isian yang diselimuti adonan pasta tipis. Biasanya disajikan dalam kaldu atau dengan saus, mereka berasal sebagai makanan tradisional dalam masakan Italia. Ravioli umumnya berbentuk bujur sangkar, meskipun bentuk lain juga digunakan, t...

 

Relation between gas pressure and volume An animation showing the relationship between pressure and volume when mass and temperature are held constant Part of a series onContinuum mechanics J = − D d φ d x {\displaystyle J=-D{\frac {d\varphi }{dx}}} Fick's laws of diffusion Laws Conservations Mass Momentum Energy Inequalities Clausius–Duhem (entropy) Solid mechanics Deformation Elasticity linear Plasticity Hooke's law Stress Strain Finite strain Infinitesimal strain Compatibil...

Church in Rome, ItalySan Pietro in MontorioChiesa di San Pietro in Montorio (in Italian)FaçadeClick on the map for a fullscreen view41°53′19″N 12°28′00″E / 41.8886°N 12.4666°E / 41.8886; 12.4666LocationPiazza di S. Pietro in Montorio 2, RomeCountryItalyDenominationRoman CatholicTraditionRoman RiteWebsiteOfficial website, unsafeHistoryStatusTitular church,national churchDedicationSaint PeterConsecrated1500ArchitectureArchitect(s)Donato BramanteArchitectural...

 

Pulau SatondaPemandangan Pulau SatondaPulau SatondaLetak Pulau Satonda di IndonesiaGeografiLokasiAsia TenggaraKepulauanKepulauan Nusa TenggaraPemerintahanNegaraIndonesia Danau Satonda Pulau Satonda adalah sebuah pulau di Provinsi Nusa Tenggara Barat, Indonesia. Pulau ini terletak di lepas pantai utara Pulau Sumbawa. Pulau ini masuk dalam wilayah Kabupaten Dompu, 3 kilometer dari Selat Sanggar di Laut Flores dan secara administratif berada di wilayah Desa Nangamiro di Kecamatan Pekat. Pulau Sa...