Pauline Grosjean٭

Claudia Senik٭٭

Esther Duflo

Ermal Hitaj

Ethan Ligon

Gerard Roland

Democracy, Market Liberalization and Political Preferences

Keywords: market and democracy, political preferences, spatial regression discontinuity, transition economies. JEL Codes: H1, H5, P2, P3, P5, O1, O12, O57

This paper questions the conventional wisdom concerning the sequencing of political and economic reforms in developing countries. We exploit the specific situation of frontier-zones as well as the considerable regional variations in culture and economic development in the countries of Central and Eastern Europe and the former Soviet Union. We estimate the impact of market development and democratization on subjective political preferences. Taking advantage of a new survey conducted in 2006 by the European Bank for Reconstruction and Development and the World Bank in 28 post-transition countries, we find a positive and significant effect of democracy on support for a market economy, but no effect of market liberalization on support for democracy. Our results are robust to the use of various indices of market liberalization and democracy and alternative measures of political preferences.

Introduction

This paper questions the conventional wisdom concerning the sequencing of political and economic reforms in developing countries. A popular idea is that market liberalization should come before democratization, in the early stage of a country's development. Supporters of this strategy point to the erratic reform path experienced by some Central and Eastern European countries of the former socialist bloc, which predominantly chose rapid and simultaneous political and economic liberalization in the 1990's [START_REF] Dewatripont | The Virtues of Gradualism and Legitimacy in the Transition to a Market Economy[END_REF][START_REF] Roland | Law Enforcement and Transition[END_REF][START_REF] Godoy | Growth, Initial Conditions, Law and Speed of Privatization in Transition Countries: 11 Years Later[END_REF]. Another example is Latin America, where pervasive economic crises seem to illustrate how democracy can be an obstacle to the development of the market, when leaders need to impose unpopular reforms while being responsible to their constituencies. By contrast, in China, the continued hold of the Communist Party over political power is taken to be a key ingredient in the spectacular development of the market economy. In this view, the optimal route is to develop market institutions in a first stage of development, and consider democratization at a later stage.

Pushing the argument one step further, some authors have argued that the desire for political freedom and democratic institutions does not arise until countries reach a certain degree of material comfort and market liberalization [START_REF] Lipset | Some Social Requisites of Democracy: Economic Development and Political Legitimacy[END_REF][START_REF] Miller | Reassessing Mass Support for Political and Economic Change in the Former USSR[END_REF][START_REF] Miller | Understanding Political Change in Post-Soviet Societies: a Further Commentary on Finifter and Mickiewicz[END_REF]. Hence, the argument goes, not only is it more practical to postpone democracy until the market is developed, but this sequence also meets citizens' preferences.

The conventional wisdom concerning the linkages between political and economic systems has considerably changed over time. The idea that "modern democracy is a by-product of the capitalist process" [START_REF] Schumpeter | Capitalism, Socialism and Democracy[END_REF] find its roots in the writings of Montesquieu, Steuart, 4 2005b, 2007a) show that this relationship is not robust to the inclusion of country fixed effects, so that there is "no evidence that economic development has a causal effect on democracy" [START_REF] Robinson | Economic Development and Democracy[END_REF]. Concerning the reverse relationship, from political regimes to economic growth, "the finding are all over the place" (Persson and Tabellini, 2007a). Many papers find no impact of democracy (or democratic transitions) to income growth [START_REF] John | Does High Income Promote Democracy?[END_REF][START_REF] Burkhart | Comparative Democracy: The Economic Development Thesis[END_REF]Lewis-Beck, 1994, Helliwell, 1994;[START_REF] Barro | Democracy and Growth[END_REF][START_REF] Rodrik | Institutions for High-Quality Growth: What they are and How to Acquire Them[END_REF] but some do find a positive relation [START_REF] Leblang | Political Democracy and Economic Growth: Pooled Cross-Sectional and Time-Series Evidence[END_REF][START_REF] Minier | Democracy and Growth: Alternative Approaches[END_REF][START_REF] Persson | Democracy and Development: The Devil in the Details[END_REF], 2007a, 2007b;[START_REF] Rodrik | Do Democratic Transitions Produce Bad Economic Outcomes?[END_REF][START_REF] Tavares | How Democracy Affects Growth[END_REF]. A meta-analysis by [START_REF] Przeworski | Political Regimes and Economic Growth[END_REF] confirms that the literature is inconclusive. The authors review 18 studies and 21 findings: a third of these concludes to the superiority of democracy in promoting economic growth, another third claims that authoritarian regimes are better at promoting growth and the last third finds no significant relationship.

Concerning the relation between democracy and market liberalization, the literature is less abundant. [START_REF] Persson | Democracy and Development: The Devil in the Details[END_REF] find that democracy is associated with economic reforms, while economic liberalization only "sometimes" leads to democratization, but that liberalizing the economy first is better for subsequent GDP growth. [START_REF] Francesco | Economic and Political Liberalizations[END_REF] claim that causality is more likely to run from political to economic liberalization. A series of papers exploit the experience of post-socialist countries, often hinging on election data or individual level surveys: they essentially conclude to a causality link running from democracy to market liberalization [START_REF] Fidrmuc | Economic Reform, Democracy and Growth during post-communist transition[END_REF]) or from democracy to the support for market liberalization (Dethier, Ghanem and Zoli,1999;[START_REF] Hayo | Public support for creating a market economy in eastern Europe[END_REF].

In this literature, the effort dedicated to the identification strategy is of uneven importance, consisting in instrumentation with lagged variables (Dethier, Ghanem and Zoli,1999), country fixed effects [START_REF] Elias | Democratization and Growth[END_REF]Siourounis 2009, Londregan and[START_REF] John | Does High Income Promote Democracy?[END_REF], country and year fixed effects [START_REF] Persson | Democracy and Development: The Devil in the Details[END_REF]Acemoglu et al. 2005aAcemoglu et al. , 2005bAcemoglu et al. , 2007a)), simultaneous equations (Tavares and Warcziag, 2001), Granger tests [START_REF] Fidrmuc | Economic Reform, Democracy and Growth during post-communist transition[END_REF], difference in difference and matching (Persson and Tabellini (2007a). However, [START_REF] Acemoglu | The Colonial Origins of Comparative Development: An Empirical Investigation[END_REF]Acemoglu et al. ( , 2005aAcemoglu et al. ( , 2007aAcemoglu et al. ( , 2007b) ) convincingly argue for the quasi impossibility to exclude the influence of omitted variables such as culture, religion or colonial institutions that preside over the evolution of all the magnitudes of interest. The influence of such distant past "critical junctures" precludes establishing a univocal direction of causality. This identification problem is also contained in the very idea of the modernization theory that the same development dynamics favor both democracy and market development [START_REF] Lipset | Some Social Requisites of Democracy: Economic Development and Political Legitimacy[END_REF]. Even papers based on panel data with time and country fixed effects are likely to suffer from omitted variables, as the relevant dimension of heterogeneity is not necessarily national: it can be more local (e.g. eastern versus western Ukraine) or wider than the nation (the lasting influence of past empires).

In this paper, we try to overcome this simultaneity bias by using the precise spatial information available in our dataset. We exploit a new set of micro evidence from an original survey of 28 transition economies, the Life in Transition Survey, which was implemented in the summer of 2006 (see EBRD, 2007). This survey offers the possibility to identify precisely the geographical location of the primary sampling units. We then hinge on the national and regional sources of heterogeneity.

We first estimate the causal relationship that runs from actual democratization to the popular support for a market economy. Our empirical identification strategy consists of a spatial regression discontinuity design, which relies on the specificities of frontier-zones. Our main identification assumption is that people who live on either side of an integrated frontier-zone experience different political regimes, but share the same experience of the market and, often, the same historically inherited "cultural attitudes" towards the market and democracy on both sides of the frontier. This assumption is particularly plausible for the often artificial frontiers of the former USSR and for other formerly integrated regions such as the Ottoman or the Habsburg Empires. This assumption is tantamount to keeping constant the omitted variables that usually bias estimations of the relationship between market development and the support for democracy.

We also estimate the reciprocal relationship, from actual market development to popular support for democracy. Here, we exploit within-country regional variations. We rely on the fact that the degree of market development is heterogeneous across different regions of the countries included in the survey, whereas people who live in the same country share a common experience of democracy. We build an index of regional market development that reflects the share of the modern sector of the economy, composed of private, small and medium size firms. We then compare the support for democracy in the various regions of a given country, where market development varies but political and democratic rights are similar. 2We do not pretend to explain the long run causality between democracy and market development; instead we ask whether the demand for democracy emerges after a certain degree of market development is reached, and whether, conversely, democratization is more likely to be an obstacle or an ingredient to citizens' support for market liberalization.

The main result of the paper is that democracy increases popular support for the market whereas, contrasting with the conventional wisdom, economic liberalization does not clearly enhance the support for democracy. This result is robust to alternative indices of democratization and market liberalization as well as to other proxies of preferences for democracy.

Section 2 presents the identification strategies for the two relationships: between democracy and support for the market, and between market development and support for democracy. Section 3 describes the data. Section 4 discusses the empirical results. Section 5 concludes.

Data

Our study uses the Life in Transition Survey (LITS) conducted by the European Bank for Reconstruction and Development and the World Bank in 2006, in 28 post-transition countries. 3 Respondents to the survey were drawn randomly, using a two stage sampling method, with census enumeration areas as Primary Sampling Units (PSUs)4 , and households as secondary sampling units. This nationally representative survey includes 1000 observations per country, making a total of 28,000 observations.

Support for the market and for democracy

Support for the market is analyzed using the following question:

Which of the following statements do you agree with most?

-A market economy is preferable to any other form of economic system.

-Under some circumstances, a planned economy may be preferable to a market economy.

-For people like me, it does not matter whether the economic system is organized as a market economy or as a planned economy.

We analyze the probability of choosing one of the first two statements.

Concerning the support for democracy, we analyze the probability of choosing one of the first two proposed answers to the question:

Which of the following statements do you agree with most?

-Democracy is preferable to any other form of political system.

-Under some circumstances, an authoritarian government may be preferable to a democratic one.

-For people like me, it does not matter whether a government is democratic or authoritarian.

One concern with this type of subjective questions is that answers might reflect some personality traits rather than genuine preferences. While there is no way to fully eliminate this concern with cross-section data, we control for several observable individual characteristics that are likely to be correlated with unobserved individual heterogeneity. We also checked that people do not answer these two questions in a systematic way. For example, people who declare that "Under some circumstances, a planned economy may be preferable to a market economy" are equally likely to choose the first or the second answer to the question about democracy.

We also use an alternative measure of support for democracy based on the following survey question:

To what extent do you agree that the following are important for your country?

-Free and fair elections -Law and order -Freedom of speech -A press that is independent from the government -A strong political opposition -A courts system that defends individual rights against abuse by the state -A courts system that treats all citizens equally, rather than favoring some over others -Protection of minority rights (religious, ethnics, etc…) -Freedom to travel abroad (Scale: Strongly disagree, Disagree, Neither agree nor disagree, Agree, Strongly agree, Difficult to say)

We construct an index measuring the "attachment to democracy", which sums the number of times a person "agrees" or "strongly agrees" that the items listed in the above table are important. The regional index varies from 0 to 9, with an average of 4.5. The average score is highest in Montenegro and Croatia (7) and lowest in Tajikistan (3).

Frontier-zones

The LITS is based on Primary Sampling Units (PSUs), each containing 20 observations (surveyed persons). Information on the precise location of these PSUs is available in a series of country maps and through the location names, which we use in order to identify groups of PSUs that are located in the immediate vicinity of a political frontier. We define frontier-zones as groups of PSUs that are quasi-adjacent and located on both sides of a frontier (less than 25 km from the border).

As discussed in section 3, the validity of our identification assumption relies on the level of trade openness and market integration across the considered borders. We thus distinguish open frontiers from those that are closed or restricted because of political tensions and disputed territories or geographical obstacles. We exclude the frontiers between Armenia and Azerbaijan, Georgia and Russia, Moldova and Ukraine, as well as all Uzbek borders. We consider all the other frontiers as open. In the case of the ten new EU members 5 , persons and goods are free to circulate across borders. This is also true of most part of Central, Eastern and South-Eastern Europe (for example Albania, Macedonia and Montenegro 6 ; Bulgaria and Macedonia or Moldova and Romania). Many countries of the survey are integrated in Euro-regions, which are "arrangements for cooperation between units of local or regional government across borders with the purpose of promoting common interests and enhancing the living standards of the border populations" 7 . Two CIS countries: Belarus and Ukraine are also integrated into Euro-regions.8

These countries are also largely integrated with Russia, not only historically but also formally, in 5 Bulgaria, the Czech Republic, Estonia, Latvia, Lithuania, Hungary, Poland, Romania, the Slovak Republic and Slovenia.

6 As well as Kosovo, but Kosovo was excluded from our sample. the framework of the Neman Euro-region which also includes Lithuania and Poland. Finally, 12 countries of the former USSR9 are members of the Commonwealth of Independent States (CIS), created in December 1991 in order to promote regional economic integration. Several other regional agreements were signed among members of the CIS, among which the creation of the Eurasian Economic Community10 , or the creation of a Common Economic Space including Belarus, Kazakhstan, Russia and Ukraine. We identify 36 valid frontier-zones, that contain between 40 and 460 observations, concentrated in 2 (Slovak Republic-Ukraine) to 24 (Croatia-Slovenia) PSUs.

Scores of democratization

We principally hinge on the Freedom House democracy score (Freedom House, 2006a), which averages national ratings for the electoral process, civil society, independent media, independence of the judicial system, and corruption. This score takes values from 1 to 7, with 1 representing the highest level of democratic progress and 7 the lowest; we have recoded it in order to present the score of democracy in an ascending order. In an alternative specification, we dichotomize this score and for each pair of adjacent countries, we build a dummy variable that takes value 1 in the PSUs located in the most democratic country of each pair, and 0 in PSUs located in the less democratic country (according to the Freedom House indicator).

For robustness, we verify that our results hold when we use other political scales, such as Freedom in the World (Freedom House, 2006b), BTI indicators (Bertelsmann Stiftung, 2005) or

Polity IV (CIDCM, 2006). We favor the Freedom House democracy score over other ratings,

12
because it is entirely focused on democratic rights, as opposed to Freedom in the World or BTI, which include ratings on civil and economic rights, and because it is more contrasted than other indicators, including Polity IV. 11

Indices of market liberalization

Using questions about the respondents' first, second and third jobs 12 , we build a regional score of market liberalization. The score is the regional proportion of respondents in the active labor force who are self-employed with more than five employees. 13 or have a formal labor contract and either: work in a small enterprise, work in a medium enterprise, work in a private firm, work in a newly created enterprise (since 1989).

During the Soviet era, socialist economies were distinguished by their exceptionally low proportion of small and medium sized enterprises (SMEs). The logic of central planning favored the organization of production and distribution in large units. We thus interpret the presence of SMEs as an indicator of market development. The presence of private and of newly created firms is also a sign of progress in the transition towards a market economy, an essential aspect of which is the process of privatization of the formerly predominant state-owned sector and the elimination of former monopolies under the pressure of new competitive firms (Berkowitz and 11 In particular, it offers a score for Montenegro different from that of Serbia.

12 Multiple jobs are frequent in transition countries. 13 This index thus excludes workers in state run enterprises or collective farms, enterprises that were already existing in 1989, large enterprises of more than 100 employees, self employed with strictly less than five employees and employees without a former labor contract. Our results are robust to variations of that index, for example by considering workers in firms larger than 100 employees or by ignoring whether employees have a formal labor contract.

Jackson, 2005). Self-employed persons with at least five employees are also part of this new economic pattern that is typical of a market economy and was absent of the landscape of planned economies. We do not count self-employed persons with less than five employees on the grounds that those are less likely to be small firms than forms of quasi unofficial economy or what is sometimes called "disguised unemployment" [START_REF] Earle | Business Start-ups or Disguised Unemployment? Evidence on the Character of Self-employment from Transition Economies[END_REF]. Finally, we interpret the existence of an employment contract as a sign that the person is working in the official sector rather than in the informal sector, an indication of development of the market economy.

This index varies from 0 to 5 with an average of 2.37. It is highest, on average, in Latvia (2.78), followed by the two other Baltic States, and is lowest in Azerbaijan (1.90) and Belarus (1.92).

One concern about our index of market liberalization is that its quality is limited by the lack of representativeness of the data at the regional level. De facto, the average number of observations by region is 82. However, there is no alternative regional index of private sector development or market liberalization that is comparable across countries of our sample. We also regret that indices of industrial concentration are not available at the regional level for the whole set of countries in the sample. 14As a first validation of our index, we compared it to other available indices of market liberalization and privatization at the country level. We used several EBRD transition indicators and constructed a Transition Indicator as the cumulated score of large scale privatization, small scale privatization, enterprise restructuring, price liberalization, competition policy, banking reform and interest rate liberalization. The correlation coefficient between this score and our index of market development is 0.77.

As an additional test of validity, we confronted our index of market development with regional indices of the shares of private, public, collective or foreign firms in Moldova in 2006, based on World Bank firm data. To remain as close as possible to the LITS index, we only considered private firms between 5 and 100 employees. The correlation coefficient between our LITS-based index and the Moldovan index is 0.34 (significant at 1%). Note that the LITS-based index considers households' addresses, while the Moldovan census records firms' registered address, which is not necessarily the same address where they operate. The LITS based index also excludes firms that existed before 1989, while the Moldovan data does not contain such information. This could explain why the correlation coefficient between the two indices is not higher.

All descriptive statistics are presented in Appendix.

Identification strategy: spatial regression discontinuity

In order to discern the direction of causality between market and democracy, one should ideally rely on a situation in which one variable is exogenously "frozen" while the other randomly takes different values across countries. Of course, in the real world this ideal setting could never exist.

On the contrary, market liberalization and democracy are processes that follow highly intertwined dynamic evolutions and depend on countries' historical background.

Even in the case of transition countries, where democracy and the market have both been abolished by the communist experience for at least half a century, these institutions have evolved in parallel since 1989, probably under the influence of common factors, such as popular pressure and the influence of European and international organizations.

As an illustration, Figure 1 shows the strong general cross-country relationship between the average support for the market and the average support for democracy in the 28 countries covered by the Life in Transition Survey. Regional differences are also visible. In particular, countries of Central and Eastern Europe and the Baltic states, which are most advanced on the road to a free market and to a full-blown democracy, are also the most supportive of the two processes.

Obviously, using the pooled cross-section data of LITS and running a naive regression of support for democracy on an index of market development, or of support for the market on a democratic index, would come across serious identification problems. The observed correlation would not readily be interpretable in terms of causality because of the influence of omitted variables affecting altogether market development, democracy and the subjective support for either political democracy or a market economy. We propose two different identification strategies in order to isolate the direction of causality from democracy to support for a market economy, and from market development to support for democracy.

Democracy and support for the market

The first question is whether a higher degree of democracy is likely to influence the support for a market economy. To address this question, one needs to overcome the problem that subjective support for a market economy may be due both to the degree of democracy and to the degree of market development itself, both variables being likely to evolve at a parallel pace. It can also be suspected that common "cultural factors" influence attitudes towards both the market and democracy. This potential heterogeneity may come from both national and more local regional history.

In other words, one would like to estimate the naive equation (1) of the support for the market of individual i in region r of country j depending on the degree of democracy in country j ( ):

(1) but one suspects that the true relationship is (1'):

(1')

where subscripts i stands for individuals, r for regions, j for countries; X irj stands for the sociodemographic characteristics of respondent i living in region r of country j, reflects the extent of market development in region r, embodies regional or national cultural factors and u i is the error term

Our strategy consists of trying to keep the second and third terms of equation (1') constant. As our analysis is based on individual data, we need to find individuals who, in an exogenous way, are confronted to different levels of democracy but to the same degree of market development and who share the same inherited "culture" regarding the politico-economic system.

The specificity of frontier-zones

We rely on the fact that the survey covers a large continuous territory comprising many contiguous countries, including observations at the political border between pairs of countries.

The idea is to identify observations in frontier-zones. We assume that, because of spatial integration, people who live in open frontier-zones are influenced by common cultural values and economic conditions, even though they live on different sides of the frontier. In other words, in frontier-zones, while political institutions and the level of democracy vary across the frontier, there is local invariance in the level of market development. This relies on two types of arguments.

The first one is the well-documented high level of interregional trade in frontier-zones [START_REF] Robert | Advanced International Trade. Theory and Evidence[END_REF]. It is well known that in frontier-zones, whenever it is possible, people do not hesitate to cross the border to work or shop. Seasonal migration (Gould 1994) and "shuttle trade" (see [START_REF] Grafe | Beyond Borders: Reconsidering Regional Trade in Central Asia[END_REF] in the case of Central Asia) are specific forms of transactions that are particularly vivid near the border, based on local social and business networks (Rauch 2002). Hence regional integration is a fact of everyday lives, which certainly influences the perception of the market by residents of the frontier-zone.

To be sure, political frontiers also act as a barrier to trade between countries, as attested by the "frontier-effect" familiar to trade economists [START_REF] Mccallum | National Borders Matter: Canada-US Regional Trade Patterns[END_REF][START_REF] Holger | Intranational Home bias in Trade[END_REF]. However, recent papers have shown that the lower intensity of trade across frontiers is essentially due to the size of countries, pricing effects (Anderson and van Wincoop 2003), language differences [START_REF] Melitz | Language and foreign trade[END_REF] and currency heterogeneity [START_REF] David | Explaining the border effect: The role of exchange rate variability, shipping costs, and geography[END_REF][START_REF] Frankel | An Estimate of the Effect of Common Currencies on Trade and Income[END_REF], rather than to political discontinuity. It is likely that these factors are less important for inhabitants of a frontier-zone than for the average citizen of a country, as the former usually speak at least one common language and are certainly less reluctant to hold the currency of the other country, which they can use frequently. Hence, even though the volume of international transactions is lower than that of intra-country transactions, bilateral trade between two countries is likely to be particularly vivid in the vicinity of the border between them. This is consistent with the well-established finding, using gravity models for instance, that distance is an obstacle to trade, in particular internal distance to the border [START_REF] Jacques | North, South and distance in the gravity model[END_REF].

Secondly, in the specific case of the 15 former Soviet republics, regional integration was a hard fact until the early 1990's. Under the socialist system, the economy of the Soviet republics was submitted to the centralized organization of material resources by the Soviet plan based in Moscow. Many countries, particularly in Central Asia and the Caucasus, have inherited from the Soviet Union integrated infrastructure networks, which is a positive factor of trade and regional integration [START_REF] Broadman | From Disintegration to Reintegration: Eastern Europe and the Former Soviet Union in International Trade[END_REF]. [START_REF] Fidrmuc | Economic Reform, Democracy and Growth during post-communist transition[END_REF] actually show that trade among the former constituent republics of the Soviet Union, of Yugoslavia and of Czechoslovakia has remained well above any definition of "normal" trade intensity, even after the disintegration of the three federations. In the case of Central Asia and Caucasus, the very slow change in patterns of trade since 1990 [START_REF] Babetskii | How Deep is your Trade?[END_REF][START_REF] Broadman | From Disintegration to Reintegration: Eastern Europe and the Former Soviet Union in International Trade[END_REF] have led researchers to argue that these countries are "overtrading" among themselves [START_REF] Grafe | Beyond Borders: Reconsidering Regional Trade in Central Asia[END_REF]. 15 Anecdotal evidence about the vivid economic activity in frontier-zones of the former socialist bloc can be found in [START_REF] Holtom | Shuttle Trade and New Border Regimes[END_REF] We verify that the degree of market development is more similar between two adjacent frontierzones than it is on average between two adjacent countries. Using the index of market development as defined in section 3.4, Table 1 shows that on average, the correlation between indices of market development is three times as high between adjacent frontier-zones of the sample (z i and z j ) as it is between adjacent countries (i and j) of the sample. If one restricts the analysis to subsets of formerly more integrated countries, the proximity between adjacent frontier-zones appears even higher. For instance, in Central Asia, the correlation between two adjacent frontier-zones is 0.78 against 0.11 in two adjacent countries (row 5 of Table 1). We also checked that in frontier-zones, the structure of employment in terms of occupations and sectors is not statistically different on either side of the borders (Table A2); by contrast this was not true of entire adjacent countries.

Cultural zones

Market integration at frontier-zones is useful to eliminate the risk that the measure of support for market liberalization reflects the actual market development; but what about "cultural" omitted factors? A first element of answer is that the citizens of the former Socialist bloc, and in particular the Soviet Union, have been living for 45 to 70 years in a common political system marked by strong official ideological values concerning the market. It is not farfetched to assume that they share a common heritage in terms of attitudes towards the market (Alesina and Fuchs-

We also rely on the fact that current frontiers of many transition countries are more or less artificial divisions of formerly integrated jurisdictions and have been frequently changing. The idea that frontiers are arbitrary has been challenged by recent empirical work, e.g. [START_REF] Schulze | On the Origins of Border Effects: Insights from the Habsburg Customs Union[END_REF] who show that frontiers can emerge spontaneously in a manner that separates heterogeneous populations and include together more homogenous groups (see also Alesina and[START_REF] Alesina | On the Number and Size of Nations[END_REF][START_REF] Alesina | Economic Integration and Political Disintegration[END_REF]. In the case of the former USSR however, frontiers and entire ethnic groups have on the contrary been artificially displaced under the Stalinist regime, mixing heterogeneous populations together and tracing arbitrary frontiers in order to minimize the risk of nationalism, secessionist movements and mobilization against the Soviet regime [START_REF] Werth | Histoire de l'Union soviétique[END_REF][START_REF] Cadiot | Searching for Nationality: Statistics and National Categories at the End of the Russian Empire (1897-1917)[END_REF]. Of course, after the dissolution of the Soviet Union new frontiers were traced, which were not all arbitrary. However, the legacy of the Stalinist territorial policy made it impossible to delimitate ethnically homogenous territories. The fact that people were free to move after the delimitation of the border does not alter our main assumption that they share many of the politico-economic attitudes with the inhabitants of the other frontierzone. Even in Central and Eastern Europe, it was only after the First World War and the collapse of the Ottoman, Tsarist, Prussian and Habsburg empires that 'nation-states' became established, and from the start, questions lingered over their viability, precisely because of unresolved 'national questions' which did not correspond to the borders of these new states, but on the contrary widely cut across them [START_REF] Batt | Introduction: Regions, State and Identity in Central and Eastern Europe[END_REF].

Estimating support for the market in frontier-zones

Our test therefore consists, for the set of inhabitants of open frontier-zones, of regressing individual support for the market on an index of democracy, controlling for frontier-zone dummies and other socio-demographic characteristics of respondents. The assumptions of (i) market integration and (ii) common culture at the frontier between two formerly integrated countries imply that the third and fourth terms of equation (1') are constant and can thus be dropped out. We thus estimate equation (1'') on the sub-samples of frontier-zones. We regress the support for the market of individual i living in frontier-zone k of country j, on the level of democracy of country j:

(1'')

where corresponds to the Freedom House democracy score of country j, stands for the socio-demographic characteristics of respondent i, living in country j and frontier zone k , is a vector of frontier-zone dummies and is the error term. In an alternative specification, we run the same regression on a dummy variable indicating whether the country of residence of an individual is more democratic than the adjacent country (i.e. we dichotomize the variable measuring the score of democracy). We also check that our results hold when alternative measures of democracy are used (see section 3).

Market development and Support for democracy

To isolate the causation running from market liberalization to support for democracy, we need to overcome the symmetrical problem, i.e. to avoid the contamination of the actual degree of democracy and the influence of "cultural factors" on support for democracy. This implies keeping constant the second and third terms of equation ( 2):

(2)

Here, we rely on the considerable within-country regional variations in terms of market development (Zhuravskaya, 2006;EBRD, 2006). We build an index that reflects the regional emergence of private, small and medium enterprises and the formal sector (see section 2.4).

We start with the simplifying assumption that political institutions and "culture" are the same in a given country. We consider that as far as democracy is concerned, the changes mainly operate at the national level, whereas the emergence of the market is more differentiated across regions.

Of course, in some countries, the degree of democracy may vary across regions if local governments have an important autonomy in terms of institutional design or implementation of federal laws. However, this problem is not likely to be important in the countries under consideration, which are rather highly centralized politically. Even in the case of the Russian federation, the strong presidential regime, whose focus has precisely been to recentralize state power [START_REF] Fish | Ten Years After the Soviet Breakup Putin's Path[END_REF], helps attenuate the (statistical) problem. In other large countries, such as Poland, Romania, Ukraine, Belarus, or Kazakhstan, power devolution to the regions and the extent of local democracy remain limited. 18 We thus identify individuals of a given country who live in regions that experience unequal degrees of market development and we estimate the support for democracy of individual i living in region r of country j on the degree of market development of region r in country j ( , controlling for individual socio-demographic characteristics and for country dummies :

(2')

In order to control for potential omitted cultural factors, we again rely on the long lasting 18 See, for example, [START_REF] Oleksandr | The Inevitability of Enduring Historical and Cultural Patterns: The Paradox of Decentralization Efforts in Ukraine[END_REF] and [START_REF] Riabchuk | Ukraine: Lessons Learned from Other Postcommunist Transitions[END_REF] for the case of Ukraine, Regulska (1997) and [START_REF] Yoder | Decentralisation and Regionalisation after Communism: Administrative and Territorial Reform in Poland and the Czech Republic[END_REF] for Poland. For Belarus or other authoritarian regimes in Central Asia, presidential power is an impediment to any form of power devolution.

influence of former empires or federations, and we run equation (2') on the various sub-samples of formerly integrated empires and federations and of today's areas of deeper integration.

Admittedly, the identification strategy for the estimation of equation (2') is weaker than that of equation (1''). Indeed, it relies on the assumption that the uneven development of the market across the regions of a country is not due to some local variable that would also affect the political attitudes of the inhabitants. In order to reduce the potential influence of such omitted variables, we control for the type of living area of respondents (metropolitan, urban or rural areas), or for the geographical distance to the capital city. Of course, this does not entirely solve the problem. For example, one could suspect that the western part of Ukraine is both more prone to democracy and to economic development than the eastern part, because it is influenced by the more "modern" values and attitudes of its western neighbors, Poland, Slovakia or Hungary.

While we recognize this risk, we assume that the heterogeneity of values and culture inside a given country is smaller than it is on average between different distant countries. The rationale is that there is more cultural distance, on average, between a Lithuanian and a Kazakh than between a Lithuanian and a Pole. This idea is based on the importance of local social interactions in the transmission of cultural traits [START_REF] Bisin | A Model of Cultural Transmission, Voting and Political Ideology[END_REF]Verdier 2001, Glaeser et al. 2001). The underlying empirical model is a transposition of gravity models, where cultural proximity is explained instead of commercial intensity. In a companion paper, we estimated a gravity model that allows assessing the role of physical distance and geopolitical factors on cultural attitudes and economic outcomes. 19 Estimating the model on the same LITS data, we found that, indeed, physical distance increases the dissimilarity in political attitudes and in economic occupation patterns between pairs of locations, while belonging to the same country, to contiguous countries or to the same former dynastic empire, decreases it. 20

Results

Although simple correlations show that supporting the market and supporting democracy are highly correlated attitudes (the correlation coefficient is 0.45), our identification strategies lead to a more contrasted picture. We find that democracy does increase support for a market economy, whereas the development of the market has no significant effect on the support for democracy.

This pattern is apparent in descriptive statistics. On average, among inhabitants of frontier-zones, the percentage of those who support the market is 7% higher on the more democratic side of the border. By contrast, there is no correlation between regional average support for democracy and the level of market development.

Democracy increases support for the market

We start with a graphical analysis that illustrates the main assumption of the spatial discontinuity regression. Using longitudinal and latitudinal coordinates of each PSU in the sample, we computed the distance of every PSU in each country to each border of this country. 21 Distances are indexed negatively when one gets closer to the political border on its least democratic side and with a positive sign on its most democratic side (in terms of the Freedom House Nations in 20 The effect is quite large. For example, sharing a common border reduces the dissimilarity in economic occupation patterns between pairs of PSUs to an extent that is equivalent to reducing the physical distance between PSUs by 3029 km (the average distance between PSU pairs being 2019 km). Belonging to the same country is tantamount to reducing the geographical distance by 2163 km and belonging to the same former dynastic empire by 1154 km. 21 We use the great circle formula [START_REF] Head | Detection of local interactions from the spatial pattern of names in France[END_REF] in order to compute the physical distance from coordinates.

Transit ranking). For example, the distance between a PSU in Poland and the Polish-Belarusian border is indexed positively, while the distance between that same PSU and the Polish-Czech border is indexed negatively. We then averaged the measure of support for the market and the index of market development across countries, by ranges of distance to the borders.

Figure 2 presents the percentage of people who support the market and the index of market development as a function of the distance to political borders. Panel (a) includes all PSUs of the sample. Support for the market is clearly higher on the "more democratic" side of the borders, but so is the index of market development, so that it is impossible to disentangle the influence of democracy on political preferences from that of market development.

Panel (b) only retains PSUs that are located less than 25 km away from a border. Support for the market is still significantly higher on the "more democratic" side of the border. 22 However, there is no longer any discontinuity at the border in the average level of market development. This indicates that the main identifying assumption of our spatial regression discontinuity is valid:

there is local invariance in the level of market development within 25 km of each border, while there is variation in political institutions and preferences for a market economy.

Figure 2 shows that support for the market is markedly higher on the most democratic side of the border. This effect is confirmed in a regression analysis. Table 2 presents the general regressions of the support for the market on scores of democratization (equation 1''). Columns 1 and 2 present the regression on the Freedom House Nations in Transit (2006a) democracy score, whereas columns 3 and 4 contain the regressions on a dummy variable representing the relative advancement of democracy (see section 3.3). All regressions are performed on the sub-sample of 22 The P-value for a negative difference between the means of "Support for the Market" between the least and the most democratic side of the border is 0.079.

27

respondents living in frontier-zones, less than 25 km away from the border. We control for frontier-zone dummies and standard errors are adjusted for clustering on frontier-zones. Finally, in Table 3, the regressions are performed within each zone of deeper cultural integration, as discussed in section 3.2.

Columns 1 and 3 in Table 2 analyze the determinants of the probability of declaring that "a market economy is preferable to any other form of economic system". The coefficients on both the democratic index and the "more democracy" dummy variable are positive and significant.

Column 1 displays the marginal effect of a change in the Freedom House democratic score, while the coefficient on the variable "more democracy" represents the effect of a discrete change of this dummy variable from 0 to 1 (on the probability to support the market). Hence, column 3 in Table 2 shows that conditionally on living in a frontier-zone, living on the "more democratic" side of the frontier increases the probability of supporting the market by about 8.8 percentage points.

Columns 2 and 4 analyze the determinants of the probability to declare that "under some circumstances, a planned economy may be preferable to a market economy". Column 2 shows that an incremental change in the democracy score does not significantly affect the preference for a planned economy. However, the coefficient on the discrete "more democracy" dummy variable is significant at 5%. Column 4 thus indicates that conditionally on living in a frontier-zone, experiencing a more democratic regime reduces the probability of favoring a planned economy by roughly 6.7 percentage points. 23Other rows of Table 2 display the other correlates of attitudes towards the market. We distinguish three income categories (the richest, middle and poorest quantiles of income inside each country), six educational levels, occupational categories, and employment status (selfemployed versus employees). Self-employed workers tend to be more supportive of the market, while elder people and the poorest third of the population are less so.

If one accepts the assumption that people living in a common frontier-zone share the same practical experience of the market (and the same background culture), the lesson of Table 2 is that living in a country with a higher degree of democracy exerts a positive influence on the support for the market.

As a robustness check, we ran the same regression as in column 3 of Table 2 within each frontier-zone. 24 The positive effect of democratic institutions on the support for the market was unchanged and proved particularly strong and significant at borders that are well integrated both culturally and economically, for example the frontier between Moldova and Romania or between Estonia and Latvia. The effect was also particularly strong for the Belarus-Lithuania, Belarus-Poland and Ukraine-Russia frontier-zones, all formerly part of the Polish-Lithuanian Commonwealth and currently highly integrated.

We also estimated equation (1'') within various sub-samples of frontier-zones belonging to historically integrated regions. Table 3 presents the regressions within "cultural zones" as defined in section 3.1. A higher level of democracy exerts a positive and significant influence on the support for the market in the regions of the former Ottoman Empire, Prussia, Polish

Lithuanian commonwealth, countries of the former USSR, of the former Yugoslavia, of the CIS and of Central Asia. By contrast, it is not significant in the former Habsburg Empire.

Nevertheless, when Hungary is excluded from the sample, the effect is positive and significant in the remaining regions of the former Habsburg Empire25 .

As a robustness check, we also tested different indicators of democracy: the Freedom of the World (Freedom House, 2006b), BTI (Bertelsmann Stiftung, 2005) and Polity IV (CIDCM, 2006) indicators. The result concerning the influence of democracy on the support for the market was preserved.

We have checked that the relation was robust to the inclusion of other country-level variables, which might have an impact on support for the market and be at the same time correlated with democracy, i.e. life expectancy, GDP per capita, the unemployment rate and the level of government expenditure as a percentage of GDP (a proxy for the importance of the welfare system). These variables were never significant in any of the regressions (in the sub-sample of border-zones).

We also considered the possibility that there might be elements of market liberalization of a country that can be taken advantage of only by citizens of that country. To get around this issue, we controlled for some measures of market liberalization, which could be associated with restrictions to entry and unequal treatment of agents depending on their nationality. We successively included in the regression: the EBRD transition indicator of small scale privatization (which also includes the tradability of land), the EBRD indicator of banking reform and the EBRD indicator of interest rate liberalization. This did not alter the results. Furthermore, these variables turned out not to be significant, consistently with the idea that there is no variation in the perception of market development across borders in frontier zones

Market liberalization does not raise the support for democracy

We now address the symmetric question whether market liberalization increases the support for democracy. As explained in section 3, we rely on the evidence that there are wide regional differences within the countries under study.

Table 4 displays various estimates of political attitudes regressed on indices of regional market development using the entire sample, i.e. including all regions of a given country. Because the impact of market development on political attitudes could be driven by metropolitan regions, in which market liberalization is more advanced and where people are likely to have specific political attitudes, we include a control for the type of area (metropolitan/urban/rural) in all regressions.

Column 1 analyzes the determinants of the probability to declare that "democracy is preferable to any other form of political system". The index of market development has no impact on this variable. Identically, the probability to declare that "under some circumstances, an authoritarian government may be preferable to a democratic one" (column 2) does not depend on the index of market development. 26 Hence, market liberalization does not appear to reinforce democratic values. Other effects indicate that the richer, better educated, younger, self-employed people and surprisingly, farmers and farm-workers, are more supportive of democracy. By contrast, the poor, those who have not completed compulsory education and women are less supportive of democracy and more likely to declare that the political system does not matter to them. These results are similar to [START_REF] Fidrmuc | Economics of Voting in Post-communist Countries[END_REF].

We also ran the same estimation of support for democracy within each country of the survey27 .

Country-wise regressions corroborated the finding that support for democracy does not increase with the market development indicator.

In Table 5, we estimate the support for democracy within each zone of deeper cultural integration. Essentially, regional market development again appears to have no significant impact on the support for democracy. The index of market development is only significant for the regions of the former Habsburg Empire. Again, when Hungary is excluded from the sample, the effect is no longer significant in the remaining regions of the former Habsburg Empire. In countries of the former USSR and of Central Asia, the impact of the market development index is significantly negative.

Finally, as robustness checks, we use alternative indicators of the explained variable (support for democracy) and of the explanatory variable (market development).

First, we use the score of "attachment to democracy", as described in section 2.1. We regress this score on the regional market development index, on the whole sample, including the usual controls and clustering at the country level. Again, our regional index of market development does not significantly influence the importance that citizens attach to democratic values. The coefficient estimate is 0.048 and the standard deviation is 0.090.

We then consider the risk that the indices of market development that we use are misconstrued.

We use an indicator of relative wealth as an alternative to the market development index. We compute the average aggregate regional income based on the real expenditures declared by the households of the survey, relative to the national average.28 This is based on the idea that aggregate income is an outcome of market development. This relative wealth index is thus more specifically an indicator of the successful outcome of market development. Again, as shown by Table 6, this indicator does not have any significant impact on the attitudes to democracy or authoritarian regimes. This contrasts with the relationship between average income and democracy that has been observed at the aggregate national level by [START_REF] Barro | Democracy and Growth[END_REF] or [START_REF] Minier | Is Democracy a Normal Good? Evidence from Democratic Movements[END_REF].

Admittedly, the identification strategy is weaker for the estimation of the relationship running from market development to the demand for democracy. This is essentially because of the risk of regional level omitted variable. In other words, there may be differences in the degree of development of democracy at the regional level, which are correlated with the regional measure of market liberalization. However, these would likely be upward biases, as more democratic countries are also those in which residents are the more supportive of democracy. The fact that we do not observe any statistical impact of the level of market development on the demand for democracy suggests that the bias is actually negligible. Still, in order to address this potential problem, we ran several robustness tests. First, in the main regression (Table 4), we controlled for the type of area where respondents live, i.e. urban/metropolitan/rural areas, as different level of urban concentration are typically correlated with the type of omitted variable that influences the variables of interest (attitudes and advancement in reforms). Alternatively, for the same reason, we controlled for the distance of respondents location to the capital city of each country, or we dropped metropolitan areas from the sample. This did not alter the results.

In summary, the degree of market development does not seem to exert a sizable impact on the political support for democracy, or on the rejection of authoritarian regimes. In contradiction with a frequently held view that democracy will "follow" market liberalization, developing market institutions is not a guarantee or a sufficient condition of the subsequent emergence of demand for democracy, even when the market is successful in raising aggregate income.

Conclusion

The main results of this paper is that, in transition countries, building democratic institutions can act as an ingredient in favor of market liberalization whereas early market development is no guarantee of subsequent popular support for democracy. This contrasts with the widespread view that the demand for democracy needs naturally emerge as a by-product of capitalism. The sequencing literature (e.g. [START_REF] Francesco | Economic and Political Liberalizations[END_REF] claims that liberalizing the economy in the first place is best for economic growth. Our results suggest that, at a certain point, democratization may become a necessary condition to obtain public support for further liberalization. To be sure, this does not exclude the risk that democracy complicates the task of reformers, with the risk of impeding market liberalization.

A possible explanation for the positive relationship between democracy and support for a market economy is the impact of democracy on income distribution. As advocated by [START_REF] Acemoglu | Why Did The West Extend The Franchise? Democracy, Inequality, And Growth In Historical Perspective[END_REF] or Acemoglu et al. (2007b), extending democratic rights can play the role of a credible commitment of the government to future income redistribution, thereby contributing to reinforce popular adhesion to the process of economic reform. For each pair of frontier zones between two countries i and j, the average indices of market liberalization (see section 3.4) are calculated at the level of frontier zone i and frontier zone j and of country i and country j.

  , in the particular example of the Russian-Lithuanian border zone: "Every day the population in Russia-Lithuania border town of Sovetsk increases by several thousand thanks to Lithuanian citizens who every morning cross the Koroleva-Luiza bridge on their way to work in the town". […] 12 Lithuanian factories have opened in Sovetsk since 2000, providing employment to the people of the town and of the neighboring Lithuanian regions". 15 Using relative prices of a bundle of goods to complement official trade data, Grafe et al. (2005) show that the impact of borders on trade between Kazakhstan, Kyrgyzstan, Uzbekistan and Tajikistan is much smaller than what the view of cumbersome crossing border procedures and licensing systems would imply. The authors attribute this result to the large development of shuttle trade in this region. Similarly, the opportunities for trade along the Polish-Ukrainian-Belarusian borders gave rise, after 1993, to bazaars and open air markets along Poland's eastern border. […] . Based on these arguments and observations, we thus assume that inhabitants of certain frontier-zones share the same experience of the market, even when they live in different countries with different political institutions.

Figure A1 .

 A1 Figure A1. Map of Dynastic Empires in Central and Eastern Europe

Table 1 : Correlation between Market Development Indices Adjacent frontiers Adjacent countries

 1

	Whole sample

Table 1 :

 1 Number of observations (frontier-zones): whole sample: 65; CIS (Armenia, Azerbaijan, Belarus, Georgia, Kazakhstan, Kyrgyz Republic, Moldova, Russia, Ukraine and Tajikistan): 23; Central Asia (Kazakhstan,

Kyrgyz Republic and Tajikistan): 5; Baltic states: 7; European Union: 26; Former USSR (CIS and Baltic States): 31; Former Yugoslavia (Bosnia and Herzegovina, Croatia, Macedonia, Montenegro, Serbia and Slovenia): 12; Former Ottoman Empire (see below): 13, Former Habsburg Empire (see below): 15; Former Polish Lithuanian Commonwealth (see below): 20.

The assumption of similar political rights within a country may be questioned, but as detailed later in the paper, most countries in our sample are highly centralized politically. Even in the case of the Russian Federation, the strong presidential regime helps to attenuate the (statistical) problem.

Turkmenistan was not included in the survey, neither was Kosovo.

PSUs were selected randomly, with probability proportional to size.

The Białowieża Forest Euroregion includes Poland and Belarus, the BUG Euroregion includes Belarus, Poland, Ukraine.

Azerbaijan, Armenia, Belarus, Georgia, Kazakhstan, Kyrgyzstan, Moldova, Russia, Tajikistan, Turkmenistan, Uzbekistan and Ukraine.

Belarus, Kazakhstan, Kyrgyzstan, Russia, Tajikistan.

In our view, indices of this type would be best suited, if they were available, than some often used indicators based on governance, the protection of legal rights, the protection of minority shareholders or indices of price liberalization. The latter have two important drawbacks: firstly, they are only available at the national level and secondly, they often reflect the progress of the rule of law, i.e. of democracy itself, rather than that of the freedom of transactions on the market.

For a detailed account of the underlying theoretical model and empirical results, see[START_REF] Grosjean | The Role of History and Geography in Cultural Diffusion: a Gravitational Approach[END_REF].

In alternative specifications not reported in this paper, we verified that our results are robust to alternative specifications, such as OLS or multinomial logit. We also checked that the results are robust to clustering at the country level. Our result holds when people who declare that "it does not matter" are excluded from the sample.

Results are not reported here but are available from the authors upon request.

The unexpected results for Hungary may be explained by the difficult situation in the country, which, at the time of the LITS, was going through a political crisis.

In alternative specifications not reported in this paper, we verified that our results are robust to alternative specifications, such as OLS or multinomial logit. The same result holds when people who declare that it "does not matter" are excluded.

Results are not reported here but are available from the authors upon request.

Household expenditures were adjusted for household size using the modified OECD equivalence scale.

We would like to thank the European Bank for Reconstruction and Development, the CEPREMAP and the Ciriacy-Wantrup Foundation for their financial assistance in this research. We thank participants in the UC Berkeley development seminar and development lunch, the Paris School of Economics Public Policy and Labor Market seminar, the Toulouse Development seminar and the EBRD lunch seminar and

Tables and Figures

Percentage of respondents who favor the market/democracy, i.e. who declare that "A market economy is preferable to any other form of economic system" and "Democracy is preferable to any other form of political system". In panel (a), distances are rounded to the nearest ten for distances up to 100 and to the nearest 50 for distances higher than 100. Notes to Table A2: We checked that the proportion of people employed in each category of the 2 digit ISIC classification of industries is identical on either side of the border (results not reported).


Ramassamy Cédric

Lamia

Hacène Fouchal
email: hacene.fouchal@univ-reims.fr

Philippe Hunel
email: philippe.hunel@univ-ag.fr

Nicolas Vidot
email: nicolas.vidot@univ-ag.fr

A Pragmatic Testing Approach for Wireless Sensor Networks

Keywords: C.4 [Performance of systems]: Fault tolerance; D.2.8 [Software Engineering]: Software/Program Verification-Formal methods, Model checking, Reliability Wireless Sensor Networks, Software Testing, Runtime Monitoring, Fault Detection Q2SWinet'10, Labelled Transition System 2 Finite State Machine 3 Timed Input

Applications over wireless sensor networks are growing quickly. Traditional software development tools are not well adapted to this technology. In particular, adequate testing methodologies are required. Many issues have not been formally addressed as energy-conservation, congestion control, reliability data dissemination, security. In this paper, we present a pragmatic approach to detect some kind of anomalies based on defined scenarios on wireless sensor networks. A scenario is considered as a set of events which should happen on the network in an ordered way. We discuss a formal architecture able to perform these scenarios over the wireless sensor networks and to raise alarms if necessary. This methodology has been implemented on a prototype and has been experimented with various examples. This contribution is a first attempt for a formal testing methodology for wireless sensor networks.

INTRODUCTION

Presently, in software industry, an important validation process is performed using various testing techniques as conformance, robustness, performance and interoperability of a system. Conformance testing consists of 2 steps: the first one deals with the generation of test sequences from a specification and the second one takes care of the execution of the sequences on an implementation which is referred to as an Implementation Under Test (IUT), and checks the reactions of the implementation in order to detect faults.

Many well known formalisms for system description are proposed like LTS 1 and FSM 2 for untimed systems and TIOA 3 and ETIOA 4 for timed systems [START_REF] Alur | A theory of timed automata[END_REF][START_REF] Lee | Principles and methods of testing finite state machines -a survey[END_REF][START_REF] Jin | A diagnostic method for non-deterministic finite state machines[END_REF]. Many methodologies have been proposed since many decades for test sequence generation. For example, in [START_REF] Berrada | Testing communicating systems : a model, a methodology and a tool[END_REF] the authors propose a model to describe a system and a method to test communicating systems. In [START_REF] Blom | Specifying and generating test cases using observer automata[END_REF] the authors propose a testing method for a system which can be described as an Extended Finite State Machine. In [START_REF] Luiz Bonifácio | A generalized model-based test generation method[END_REF] the authors propose a generalization of the W-method (from T. S. Chow [START_REF] Chow | Testing software design modeled by finite-state machines[END_REF]) for a specification which do not has a characterization set. A survey about testing Real-Time systems can be found in [START_REF] Broy | Model-Based Testing of Reactive Systems: Advanced Lectures[END_REF][START_REF] Constant | Génération automatique de tests pour des modèles avec variables ou récursivité[END_REF][START_REF] Hessel | A test case generation algorithm for real-time systems[END_REF] and FSM [START_REF] Fujiwara Bochmann Khendek | Test selection based on finite state models[END_REF]. Some other works [START_REF] Cacciari | Controllability and observability in distributed testing[END_REF][START_REF] Khoumsi | Testing distributed real time systems using a distributed test architecture. Computers and Communications[END_REF][START_REF] Khoumsi | Test execution for distributed real time systems[END_REF][START_REF] Pereira | Distributed real-time embedded systems: Recent advances, future trends and their impact on manufacturing plant control[END_REF][START_REF] Hoarau | Injection de fautes dans les systèmes distribués[END_REF] are dedicated to embedded systems and distributed systems.

Wireless sensor networks have been studied in academia and industry in recent years. Their main advantages are the ability to have computation and communication capabilities as well as a reduced cost. WSN can be used for many applications such as habitat monitoring, in-door monitoring, target tracking, and security monitoring, etc. However, embedded applications over WSN are not widely deployed since WSN have still some issues to overcome, for exam-ple, energy-conservation, congestion control, reliability data dissemination, security and management of a WSN itself.

In this study, we propose an architecture to test wireless sensor networks. The user may monitor the system by using this methodology. He may also execute test sequences using defined scenarios on WSN. On one hand, the monitoring process checks if the system works properly, and on another hand the scenario ensures a low level conformance for the system. A scenario describes a test sequence to be experimented on the implementation. It is composed of an ordered set of input actions with the average waiting time before two successive actions. The formalism suggested in [START_REF] Khoumsi | Test execution for distributed real time systems[END_REF][START_REF] Saifan | Run-time conformance checking of mobile and distributed systems using executable models[END_REF] is used to represent our scenarios. This paper is organized as follows. Section 3 presents a description of scenario generation, test architecture and test execution. Section 4 describes a prototype case study to illustrate our approach. Section 5 concludes the study.

RELATED WORK

Distributed systems may be viewed as a set of components connected via a communication system, where each component sends and/or receives messages through one or more communication channels. Distributed testing was studied with different test architectures. [START_REF] Khoumsi | Testing distributed real-time systems in the presence of inaccurate clock synchronization[END_REF] proposed a distributed tester, with the distribution of global test sequence (GTS) into local test sequences executed over local testers, where the synchronization and the fault detection problems are discussed.

A noticeable work has been done on distributed testing [START_REF] Khoumsi | Testing distributed real-time systems in the presence of inaccurate clock synchronization[END_REF]; however, only few of them, [START_REF] Bertolino | Deriving test plans from architectural descriptions[END_REF], [START_REF] Zimmerer | Test architectures for testing distributed systems[END_REF] dealt with testing component based systems, and others [START_REF] Schmidt | Trustworthy components-compositionality and prediction[END_REF], [START_REF] Zalewski | Developing component-based software for real-time systems[END_REF], [START_REF] Tesanovic | Towards aspectual component-based development of real-time systems[END_REF] studied the construction of component based systems. [START_REF] Khoumsi | Testing distributed real-time systems in the presence of inaccurate clock synchronization[END_REF], handles testing distributed real-time systems, proposing a method for solving the controllability and observability problem by holding some timing constraints. [START_REF] Khoumsi | Testing distributed real-time systems in the presence of inaccurate clock synchronization[END_REF] assumed a more realistic clock between testers synchronizing with a reference clock with a given inaccuracy rather than synchronizing with other tester's clock.

In Component Based Systems (CBS), components must interact with different external elements [START_REF] Zalewski | Developing component-based software for real-time systems[END_REF]. Those components may run on a single, multiple, distributed or network systems in a sequential or individual concurrent manner, and may communicate with every other component. Such systems require a tight and loose coupling of components of diverse granularity. [START_REF] Schmidt | Trustworthy components-compositionality and prediction[END_REF] takes into consideration some major requirements such as, flexibility, time-to-market, quality, cross-department standardization. With all its advantages, CBS still lacks some aspects of real-time systems that cannot be encapsulated in a component such as synchronization, and memory optimization [START_REF] Tesanovic | Towards aspectual component-based development of real-time systems[END_REF]. From the above requirements, it is clear how complex and sensitive it is to build and to have a reliable tested component-based system.

In [START_REF] Werner-Allen | Motelab: a wireless sensor network testbed[END_REF], MoteLab, a Web-based sensor network testbed is presented. MoteLab consists of a set of permanently-deployed sensor network nodes connected to a central server which handles reprogramming and data logging while providing a web interface for creating and scheduling jobs on the testbed. MoteLab accelerates application deployment by streamlining access to a large, fixed network of real sensor network devices; it accelerates debugging and development by automating data logging, allowing the performance of sensor network software to be evaluated offline. Additionally, by providing a web interface MoteLab allows both local and remote users access to the testbed, and its scheduling and quota system ensure fair sharing.

In [START_REF] Abhishek | Sensor faults: Detection methods and prevalence in real-world datasets[END_REF], authors deal with the observation of faults in real deployments. They considered three types of transient faults, caused by faulty sensor readings that appear abnormal. To understand the prevalence of such faults, they explore four qualitatively different classes of fault detection methods: 1) Rule-based methods leverage domain knowledge to develop heuristic rules for detecting and identifying faults; 2) Learning methods about the system behavior; 3) Estimation methods predict to normal sensor behavior by leveraging sensor correlations, flagging anomalous sensor readings as faults; 4) Time-series-analysis-based methods start with an a priori model for sensor readings. A sensor measurement is compared against its predicted value computed using time series forecasting to determine if it is faulty. They concluded that: training data, and then statistically detect and identify classes of faults. These four classes of methods sit at different points on the accuracy/robustness spectrum. Rulebased methods can be highly accurate, but their accuracy depends critically on the choice of parameters. Learning methods can be cumbersome to train, but can accurately detect and classify faults. Estimation methods are accurate, but cannot classify faults. Time-series-analysis-based methods are more effective for detecting short duration faults than long duration ones, and incur more false positives than the other methods. They apply these techniques to four realworld sensor datasets and find that the prevalence of faults as well as their type varies with datasets. All four methods are qualitatively consistent in identifying sensor faults, lending credence to our observations.

In [START_REF]Tutornet: A tiered wireless sensor network testbed[END_REF] is a tiered wireless sensor network testbed. It consists of 13 clusters, with each cluster consisting of a stargate and several motes attached to it via USB cables. These stargates communicate with a central PC over 802.11b, from where any node on the testbed can be programmed. Thus a testbed consisting of 13 stargates and 104 motes ( 91 tmoteSky and 13 MicaZ ) is currently running in at University of Southern California. The main features of Tutornet are Tiered sensor network testbed: consists of 3 tiers staring with top tier, the testbed sever is on the top, Stargates, and then motes respectively. Wireless multi-hop routing between the testbed server and a stargate or among stargate is performed.

[15] extends the Emulab network testbed software to provide a remotely-accessible mobile wireless and sensor testbed. Robots carry motes and single board computers through a fixed indoor field of sensor-equipped motes, all running the user's selected software. In real-time, interactively or driven by a script, remote users can position the robots, control all the computers and network interfaces, run arbitrary programs, and log data. This mobile testbed provides simple path planning, a vision-based tracking system accurate to 1 cm, live maps, and webcams. Precise positioning and automation allow quick and painless evaluation of location and mobility effects on wireless protocols, location algorithms, and sensor-driven applications. The system is robust enough that it is deployed for public use. [START_REF] Handziski | Twist: a scalable and reconfigurable testbed for wireless indoor experiments with sensor networks[END_REF] presents TWIST, a scalable and reconfigurable testbed architecture for indoor deployment of wireless sensor networks. The design of TWIST is based on an analysis of typical and desirable use-cases. It provides basic services like node configuration, network-wide programming, outof-band extraction of debug data and gathering of application data. TWIST supports experiments with heterogeneous node platforms. it also supports active power supply control of the nodes. This enables easy transition between USB-powered and battery-powered experiments, dynamic selection of topologies as well as controlled injection of node failures into the system. Thirdly, TWIST supports creation of both at and hierarchical sensor networks. The selfconfiguration capability, the use of hardware with standardized interfaces and open-source software makes the TWIST architecture scalable, affordable, and easily replicable.

In all these studies, the main objective is to check if the data handled by the wireless sensor network are computed without errors. The testing is data oriented. In our case, we intend to focus on the behavior checking. We will test how the network react to stimulus sent by the environment. This kind of testing aims to prove if the expected correct behavior of the whole network will be executed without any fault. Our technique is inspired from protocol testing engineering field that we adapt to the wireless sensor networks.

CONTRIBUTION

Our goal is to check if a wireless sensor network works without executing faulty actions. The approach aims to detect anomalies related to defined scenarios on wireless sensor networks. The objective is to provide an appropriate testing methodology for WSN.

Definitions

In this section, we introduce some notions needed to describe the approach as an observer, a scenario, a node and some other notions and notations used in the paper. Definition 1. (Node) A node is a sensor which could be connected to some neighbor nodes.

In our case the communication is performed through a wireless method. Definition 2. (Network) A WSN is a network composed of nodes. It executes a distributed application. Each node execute a part of the application (usually all of them has the same code) Definition 3. (Reaction Time) Reaction time is an upper bound of time amount between : (i) the instant when an event e is received by a node and (ii) the instant when a node has ended to send all its outputs (if any) as a reaction to the reception of e. This node is particular. Its role is to monitor the network in a remote way and will not participate to the application execution.

Definition 5. (Transfer Time) Transfer time, denoted ∆, between observers and nodes, is defined as the time amount between : (i) the instant when a message M is sent and (ii) the instant when M is received.

In general this delay expresses network topology complexity. In most of cases, we assume that we have no delay between observers or sensors. Definition 6. (WSN application) A WSN application is characterized by a set of events and tasks.

The application is composed of tasks over all nodes. We need to describe the events observed over the network. These events are the key point of our testing process. Definition 7. (Black-box testing) Black-box testing uses external descriptions of the software, including specifications, requirements, and design to derive test cases. These test cases can be functional or non-functional. There is no knowledge about internal structure of the implementation to test. This kind of testing is very common in hardware and protocol engineering. For competition reasons, many companies (like electronic device producers) do not wish to show the internal structure of their products. But all companies which need to use these kind of products should perform blackbox testing in order to check if some non required behavior is observed on the products they intend to use (like telecom providers). Definition 8. (Scenario) A scenario is described by a test sequence. A test sequence is an ordered set of of action/reactions where each event corresponds to the reception of an input and a response is the output generated after receiving an event.

Scenario generation may be achieved by an user. A scenario must be generic enough to check if the system works properly. Automatic generation is widely required for large systems and will ensure formally fault coverage as described in [START_REF] Khoumsi | Test execution for distributed real time systems[END_REF][START_REF] Saifan | Run-time conformance checking of mobile and distributed systems using executable models[END_REF]. The base station is the interface between the observer and the WSN. The observer is connected to the base station through a serial port, a parallel port or a network port.

Definition 9. (Correct scenario) Let a sequence of input action tia = a1, a2, ..., an and output reaction trm = b1, b2, ..., bn. An execution of scenario on a WSN is correct iff : (1)bi is the reaction to ai (2) ai is executed before ai+1 and bi before bi+1; and (3) the timing constraints (reaction time) between the input event and output reaction are respected.

Due to radio range coverage of a node, we use distributed observers to be sure to cover all nodes in the WSN. In Sect. 3.2, we detail the repartition method of observers.

The approach

Our testing approach is based on monitoring scenario execution on a WSN. This monitoring is ensured by distributed observers. Observers are controlled by a user (or by an automated process). In order to determine the observers location on the network, we split the network into several sub-networks. This is done according to the radio range coverage of sensors. For each sub-network, we have a local base station which will be used to collect the sub-network data.

Test Architecture

For each sub-network, we set an observer and a base station. The approach is based on the following parts :

➢ The base station is a specific node. It is a relay node able to provide a communication between an observer and all sensors of the related sub-network .

➢ The observer is the tester. Its role is to send input action and receive output reaction through the base station. The observer analyzes output reactions and checks if timed constraints are respected. The aim is to check if a scenario is executed properly over the network.

➢ The user controls the scenario execution. He can check if an anomaly is observed over the network (dead links, energy decrease, congestion control, overload, etc).

➢ The verdict is produced by an observer and concludes if the WSN encounters anomalies.

Scenario generation

In order to achieve the generation of scenarios, we have to describe the application with a formal formalism like LTS (Labelled Transition Systems). Then a generation of most pertinent sequences could be done by a well-known technique as W-method for example. That means we do not need to generate all possible sequences. When the application is very large, a space explosion can be expected. In practical cases, this generation is oriented by the user.

EXPERIMENTATION

We have implemented a prototype tool which implements our approach.

The prototype

This prototype is composed of three parts :

➢ The application.

➢ The scenario management, ➢ The analysis and monitoring of messages sensors.

The environment

In our tool, we achieved the testing process on a real environment. The application to test is deployed over a WSN. It is written in NesC language. The framework is composed of two base stations, five sensors and a computer. Sensors communicate using the Zigbee protocol (802.15.4). Computer communicates with base station using USB connection Figure . 2.

The network

The sensor radio coverage may be represented by groups denoted sub-networks (Figure 4). Sensors are spread using geographically random way, they represent sub-networks communication (Figure 4 is an example).

The application

The application is deployed over the whole WSN. The following three events are possible on each sensor:

➢ The timer management event ➢ The radio management event (switch on or off),

➢ The message sending/receiving management event.

Each sensor has a message setup to 0. On the sub-network, one sensor is dedicated to sense a value from the environment (temperature, pressure,..). This sensor updates its message with the sensed value. Every 20 seconds, it broadcasts its message on the network. When it receives a message (from the base station or from another sensor), it compares its local message to the received one and updates its local message with the received one if this later is greater.

The first aim is to guarantee that messages observed on subnetworks are identical on all nodes.

The observer

Here we describe the observer application we have implemented over all observers.

Our application is written in JAVA, thus we have to implement a library allowing communication in USB port. Although current libraries are very limited 5 , then we use TinyOS library for USB communications between the base station and the computer.

Our application is split in two parts. The first part is dedicated to sending input actions to the network and the second part is dedicated to receive reactions.

Network listening

The network listening is achieved according to radio range coverage of the base station. We catch, during data sending, messages from all sensors and we analyze their contents. The packet structure is detailed as follows:

Src Dest AM Grp Len Data (2) (2) (1) (1)
(1) (0...29)

Scenario Sending

The aim of our scenario is to send every 5 seconds a message on the network via the base station. This message represents a number which will be increased after each step. Message sending is a broadcast to all sensors located in the radio range of the sub-network.

Results

We tested two representations of the network described on Figure 5 and on Figure 6.

In the first case, all sensors communicate in the radio range of the base station. We notice that dead nodes and bad communications are detected by the observer application in all cases. Nevertheless, we have no guarantee on packet lost. The application can check in the first iteration that the sensor has some troubles. But if in the second iteration sensor message is received, the application can decide if this sensor is in bad location regarding radio range coverage.

In the second case, some sensors are located in the radio range of the sub-network and all others are outside of it. But the connectivity is guaranteed by having some relaying sensors on the sub-network. We have observed the same results than in the previous case. But if a sensor relay is switched off (Figure 7), we have observed communication troubles. That allows us to expect the use of a router node for future works.

Up to now, we have not described formally all faults we are able to detect. But next investigations of our work will be dedicated to collect all possible faults and to show formally how are we able to detect these faults by our methodology.

CONCLUSION AND FUTURE WORK

We described a distributed test architecture for Wireless Sensor Networks by using observers. We presented a methodology to check if some faults occur on a wireless sensor network. The main contribution is the use of collaboratives observers over the WSN. The observers checks the correctness of the application by means of monitoring a scenario over the whole network. Thanks to this, we can establish a kind of conformance relation.

Two important issues will be investigated in the next future:

➢ Formal description of faults: this issue is very useful and could be used for fault coverage.

➢ Robustness of the monitoring process: this issue en-sures that the monitoring is able to be maintained even if some observers have troubles.

R. Cardell-Oliver shows in [START_REF] Cardell-Oliver | Field testing a wireless sensor network for reactive environmental monitoring[END_REF] works about robustness and longevity of network on WSN to rainfall.

Finally, we intend also to handle a real-time monitoring for energy levels, network quality, sensor workloads.

Figure 1 :

 1 Figure 1: Sequence exchange

Figure 2 :

 2 Figure 2: Observer with Base Station

Figure 3 :

 3 Figure 3: Test Architecture

Figure 4 :

 4 Figure 4: Sub networks

Figure 5

 5 Figure 5: First Representation

Figure 7 :

 7 Figure 7: A router node

Table 1 :

 1 TinyOS packet format. The byte size of the fields are detailedWe catch messages in transit on the network and analyze if messages from all sensors are the same. Our main aims are:

➢ Collecting sensor messages, ➢ Analyzing messages and timing constraints.